Skip to content

Commit bb2ef26

Browse files
author
Arvid Paeglit
committed
new eslint and prettier config
1 parent ab88425 commit bb2ef26

5 files changed

Lines changed: 66 additions & 8631 deletions

File tree

.eslintrc.js

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
module.exports = {
2-
'env': {
3-
'es6': true,
4-
'node': true
5-
},
6-
'extends': 'standard',
2+
'plugins': [
3+
'@typescript-eslint',
4+
'prettier',
5+
'import'
6+
],
7+
'extends': [
8+
'eslint:recommended',
9+
'airbnb-base',
10+
'plugin:@typescript-eslint/recommended',
11+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
12+
'plugin:prettier/recommended',
13+
'prettier',
14+
'prettier/@typescript-eslint'
15+
],
716
'globals': {
817
'Atomics': 'readonly',
918
'SharedArrayBuffer': 'readonly'
1019
},
20+
'parser': "@typescript-eslint/parser",
1121
'parserOptions': {
12-
'ecmaVersion': 2018,
22+
'ecmaVersion': 2020,
1323
'sourceType': 'module',
14-
'parser': 'babel-eslint'
24+
'project': './tsconfig.json'
25+
},
26+
'env': {
27+
'es6': true,
28+
// 'browser': true,
29+
'node': true
1530
},
1631
'rules': {
1732
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
@@ -22,16 +37,39 @@ module.exports = {
2237
],
2338
'require-jsdoc': 'off',
2439
'space-before-function-paren': 'off',
25-
'semi': 'off',
2640
'comma-dangle': 'off',
2741
'object-curly-spacing': 'warn',
2842
'padded-blocks': 'off',
2943
'camelcase': 'warn',
3044
'object-property-newline': 'off',
31-
'prefer-const': 'off',
45+
'prefer-const': 'warn',
3246
'import/no-absolute-path': 'off',
3347
'no-prototype-builtins': 'off',
3448
'indent': 'warn',
35-
'quote-props': 'off'
36-
}
49+
'quote-props': [
50+
'warn',
51+
'as-needed'
52+
],
53+
'lines-between-class-members': 'off',
54+
'import/extensions': ['error', 'ignorePackages', {
55+
js: 'never',
56+
mjs: 'never',
57+
jsx: 'never',
58+
ts: 'never',
59+
tsx: 'never',
60+
}],
61+
'no-restricted-syntax': 'off',
62+
'no-await-in-loop': 'warn',
63+
'no-underscore-dangle': 'off',
64+
'max-classes-per-file': 'off',
65+
'@typescript-eslint/restrict-template-expressions': 'off',
66+
'@typescript-eslint/no-unsafe-assignment': 'warn',
67+
},
68+
'settings': {
69+
'import/resolver': {
70+
node: {
71+
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.vue'],
72+
},
73+
},
74+
},
3775
}

.prettierrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
useTabs: false,
7+
tabWidth: 2,
8+
bracketSpacing: true,
9+
arrowParens: 'avoid',
10+
};

0 commit comments

Comments
 (0)