Skip to content

Commit 3ca4a2b

Browse files
Merge pull request #52 from RadKod/feature/linters
Feature/linters
2 parents 0efb86b + 6f3eb96 commit 3ca4a2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3442
-1264
lines changed

.eslintignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
dist
2+
/vue2
3+
/vue3
4+
/docs
5+
/meta
6+
coverage
7+
node_modules
8+
package.json
9+
package-lock.json
10+
yarn.lock
11+
pnpm-lock.yaml

.eslintrc.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
jest: true
7+
},
8+
parser: 'vue-eslint-parser',
9+
parserOptions: {
10+
parser: '@typescript-eslint/parser',
11+
sourceType: 'module',
12+
ecmaFeatures: {
13+
legacyDecorators: true
14+
},
15+
warnOnUnsupportedTypeScriptVersion: false,
16+
templateTokenizer: {
17+
pug: 'vue-eslint-parser-template-tokenizer-pug'
18+
}
19+
},
20+
extends: ['plugin:vue/strongly-recommended', 'eslint-config-prettier', 'prettier'],
21+
plugins: ['@typescript-eslint', 'prettier'],
22+
rules: {
23+
'prettier/prettier': [
24+
'error',
25+
{
26+
endOfLine: 'crlf'
27+
}
28+
],
29+
'max-len': [
30+
'error',
31+
{
32+
code: 150,
33+
ignoreComments: true,
34+
ignoreStrings: true,
35+
ignoreTemplateLiterals: true
36+
}
37+
],
38+
'no-multiple-empty-lines': [2, { max: 2 }],
39+
semi: ['error', 'never'],
40+
'arrow-parens': ['error', 'as-needed'],
41+
'no-extend-native': 'off',
42+
'space-before-function-paren': 'off',
43+
camelcase: 'off',
44+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
45+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
46+
'no-throw-literal': 'off',
47+
'no-param-reassign': [
48+
'error',
49+
{
50+
props: false
51+
}
52+
],
53+
'@typescript-eslint/no-var-requires': 'off',
54+
'vue/component-definition-name-casing': ['error', 'PascalCase'],
55+
'vue/multi-word-component-names': 'off',
56+
'vue/component-tags-order': ['error', { order: ['template', 'script', 'style', 'docs'] }],
57+
'vue/padding-line-between-blocks': ['error'],
58+
'vue/block-lang': [
59+
'error',
60+
{
61+
script: {
62+
allowNoLang: true,
63+
lang: 'ts'
64+
},
65+
style: {
66+
allowNoLang: true,
67+
lang: 'scss'
68+
}
69+
}
70+
],
71+
'vue/no-empty-component-block': 'off',
72+
'vue/valid-template-root': 'off',
73+
'vue/no-static-inline-styles': 'off',
74+
'vue/require-prop-types': ['error'],
75+
'vue/require-default-prop': ['error'],
76+
'vue/attribute-hyphenation': ['error', 'always'],
77+
'vue/v-on-event-hyphenation': ['error', 'always'],
78+
'vue/html-self-closing': 'off',
79+
'vue/no-v-html': 'off',
80+
'vue/order-in-components': ['error'],
81+
'padding-line-between-statements': [
82+
'error',
83+
{ blankLine: 'always', prev: '*', next: 'return' },
84+
{ blankLine: 'always', prev: '*', next: 'if' },
85+
{ blankLine: 'always', prev: '*', next: 'switch' },
86+
{ blankLine: 'always', prev: '*', next: 'for' },
87+
{ blankLine: 'always', prev: '*', next: 'function' },
88+
{ blankLine: 'never', prev: 'import', next: 'import' },
89+
{ blankLine: 'always', prev: 'import', next: 'export' },
90+
{ blankLine: 'always', prev: 'expression', next: 'export' },
91+
{ blankLine: 'always', prev: 'import', next: 'expression' }
92+
]
93+
}
94+
}

.huskyrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
hooks: {
33
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
4+
'pre-commit': 'lint-staged'
45
}
56
}

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
./demo
22
./dev
33
./docs
4+
.vscode

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.x.x

.prettierignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
dist
2+
/vue2
3+
/vue3
4+
/docs
5+
/meta
6+
coverage
7+
node_modules
8+
package.json
9+
package-lock.json
10+
yarn.lock
11+
pnpm-lock.yaml

.prettierrc.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
module.exports = {
2+
pugPrintWidth: 140,
3+
pugSingleQuote: false,
4+
pugAttributeSeparator: 'none',
5+
pugEmptyAttributes: 'none',
6+
singleQuote: true,
7+
printWidth: 140,
8+
trailingComma: 'none',
9+
tabWidth: 2,
10+
semi: false,
11+
bracketSpacing: true,
12+
arrowParens: 'avoid',
13+
pugSortAttributesBeginning: [
14+
'^cols$',
15+
'^v-else$',
16+
'^v-for$',
17+
'^:key$',
18+
'^v-if$',
19+
'^v-else-if$',
20+
'^v-on$',
21+
'^v-bind$',
22+
'^ref$',
23+
'^v-model',
24+
'^name$',
25+
'^:?type$',
26+
'^:value$',
27+
'^v-text$',
28+
'^:?label$',
29+
'^:headers$',
30+
'^:items$',
31+
'^:?item-text$',
32+
'^:?item-value$',
33+
'^:?item-disabled$',
34+
'^:?placeholder$',
35+
'^:?src$',
36+
'^:?color$',
37+
'^:?text-color$',
38+
'^:?icon$',
39+
'^:?small$'
40+
],
41+
pugSortAttributesEnd: [
42+
'^:?hint$',
43+
'^:?persistent-hint$',
44+
'^prepend-',
45+
'^@click:prepend',
46+
'^append-',
47+
'^@click:append',
48+
'^:to$',
49+
'^exact$',
50+
'^:(?!(width|height|loading|disabled|data-))',
51+
'^target$',
52+
'^:?width$',
53+
'^:?height$',
54+
'^:loading$',
55+
'^:disabled$',
56+
'^:?data-',
57+
'^@click',
58+
'^@'
59+
]
60+
}

.stylelintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dist
2+
/vue2
3+
/docs
4+
/meta
5+
*.min.*
6+
assets/**/*/vendor
7+
static/
8+
public/

.stylelintrc.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
module.exports = {
2+
extends: [
3+
//https://github.com/constverum/stylelint-config-rational-order
4+
'stylelint-config-rational-order',
5+
// https://github.com/shannonmoeller/stylelint-config-prettier
6+
'stylelint-config-prettier'
7+
],
8+
overrides: [
9+
{
10+
customSyntax: 'postcss-scss',
11+
files: ['**/*.{css,sass,scss,less,stylus}']
12+
},
13+
{
14+
customSyntax: 'postcss-html',
15+
files: ['*.vue', '**/*.vue']
16+
}
17+
],
18+
plugins: [
19+
// https://github.com/kristerkari/stylelint-scss#list-of-rules
20+
'stylelint-scss',
21+
// https://github.com/hudochenkov/stylelint-order
22+
'stylelint-order',
23+
'stylelint-config-rational-order/plugin'
24+
],
25+
rules: {
26+
indentation: [
27+
2,
28+
{
29+
baseIndentLevel: 0
30+
}
31+
],
32+
'color-named': 'never',
33+
'color-function-notation': 'legacy',
34+
'at-rule-no-unknown': null,
35+
'declaration-empty-line-before': [
36+
'always',
37+
{
38+
except: ['after-declaration'],
39+
ignore: ['after-comment', 'first-nested', 'inside-single-line-block'],
40+
severity: 'warning'
41+
}
42+
],
43+
'rule-empty-line-before': [
44+
'always',
45+
{
46+
ignore: ['after-comment', 'first-nested'],
47+
severity: 'warning'
48+
}
49+
]
50+
}
51+
}

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"stylelint.vscode-stylelint",
5+
"editorconfig.editorconfig",
6+
"octref.vetur",
7+
"fallenmax.mithril-emmet"
8+
]
9+
}

.vscode/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"emmet.showAbbreviationSuggestions": true,
3+
"emmet.showExpandedAbbreviation": "always",
4+
"emmet.includeLanguages": {
5+
"vue-html": "html",
6+
"vue": "jade"
7+
},
8+
"files.insertFinalNewline": true,
9+
"editor.insertSpaces": true,
10+
"editor.detectIndentation": false,
11+
"css.validate": false,
12+
"less.validate": false,
13+
"scss.validate": false,
14+
"stylelint.validate": ["css", "scss", "html", "vue"],
15+
"editor.codeActionsOnSave": {
16+
"source.fixAll.stylelint": true,
17+
"source.fixAll.eslint": true
18+
},
19+
"editor.tabSize": 2,
20+
"explorer.compactFolders": false
21+
}

babel.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const devPresets = ['@vue/babel-preset-app'];
1+
const devPresets = ['@vue/babel-preset-app']
22
const buildPresets = [
33
[
44
'@babel/preset-env',
@@ -8,10 +8,10 @@ const buildPresets = [
88
// include: [
99
// /(optional-chaining|nullish-coalescing)/
1010
// ],
11-
},
11+
}
1212
],
13-
'@babel/preset-typescript',
14-
];
13+
'@babel/preset-typescript'
14+
]
1515
module.exports = {
16-
presets: (process.env.NODE_ENV === 'development' ? devPresets : buildPresets),
17-
};
16+
presets: process.env.NODE_ENV === 'development' ? devPresets : buildPresets
17+
}

0 commit comments

Comments
 (0)