Skip to content

Commit 8653a2f

Browse files
authored
Update eslint config (#114)
* Update eslint config * Try to readd dependency * Update eslint config * Try to readd dependency * remove dependency * Update package-lock * Regenerate package-lock * Add to gitignore
1 parent e197ce7 commit 8653a2f

File tree

10 files changed

+838
-402
lines changed

10 files changed

+838
-402
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/node_modules/
2+
.DS_Store

config/base-rules.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ module.exports = {
44
node: true,
55
},
66
extends: ['eslint:recommended'],
7-
plugins: ['jsdoc'],
87
rules: {
98
/*
109
* Possible errors
@@ -90,7 +89,7 @@ module.exports = {
9089
'no-var': 'error',
9190

9291
// Require method and property shorthand syntax for object literals
93-
'object-shorthand': ['error', 'consistent-as-needed'],
92+
'object-shorthand': ['error', 'always'],
9493

9594
// Require `const` declarations for variables
9695
// that are never reassigned after declared
@@ -101,20 +100,5 @@ module.exports = {
101100

102101
// Disallow spacing around embedded expressions of template strings
103102
'template-curly-spacing': 'error',
104-
105-
/*
106-
* JSDoc plugin
107-
*/
108-
109-
'jsdoc/check-param-names': 'warn',
110-
'jsdoc/check-syntax': 'warn',
111-
'jsdoc/check-tag-names': 'warn',
112-
'jsdoc/check-types': ['warn', { noDefaults: true }],
113-
'jsdoc/require-param': 'warn',
114-
'jsdoc/require-param-description': 'warn',
115-
'jsdoc/require-param-name': 'warn',
116-
'jsdoc/require-returns-check': 'warn',
117-
'jsdoc/require-returns-description': 'warn',
118-
'jsdoc/valid-types': 'warn',
119103
},
120104
};

config/javascript-overrides.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
plugins: ['jsdoc'],
23
files: ['*.js', '*.jsx'],
34
parserOptions: {
45
ecmaFeatures: {
@@ -10,8 +11,22 @@ module.exports = {
1011
rules: {
1112
strict: ['error', 'global'],
1213

14+
/*
15+
* JSDoc plugin
16+
*/
17+
18+
'jsdoc/check-param-names': 'warn',
19+
'jsdoc/check-syntax': 'warn',
20+
'jsdoc/check-tag-names': 'warn',
21+
'jsdoc/check-types': ['warn', { noDefaults: true }],
1322
'jsdoc/no-undefined-types': 'warn',
23+
'jsdoc/require-param': 'warn',
24+
'jsdoc/require-param-description': 'warn',
25+
'jsdoc/require-param-name': 'warn',
1426
'jsdoc/require-param-type': 'warn',
27+
'jsdoc/require-returns-check': 'warn',
28+
'jsdoc/require-returns-description': 'warn',
1529
'jsdoc/require-returns-type': 'warn',
30+
'jsdoc/valid-types': 'warn',
1631
},
1732
};

config/solid-overrides.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
files: ['*.tsx'],
3+
plugins: ['solid', 'react'],
4+
extends: ['plugin:solid/recommended', 'plugin:react/recommended'],
5+
parser: '@typescript-eslint/parser',
6+
parserOptions: {
7+
ecmaFeatures: {
8+
jsx: true,
9+
},
10+
project: 'tsconfig.json',
11+
tsconfigRootDir: '.',
12+
},
13+
rules: {
14+
'react/react-in-jsx-scope': 'off',
15+
'react/no-unknown-property': 'off',
16+
'react/jsx-key': 'off',
17+
},
18+
};

config/typescript-overrides.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
23
files: ['*.ts', '*.tsx'],
34
extends: [
45
'plugin:@typescript-eslint/eslint-recommended',
@@ -13,15 +14,16 @@ module.exports = {
1314
project: 'tsconfig.json',
1415
tsconfigRootDir: '.',
1516
},
16-
plugins: ['@typescript-eslint'],
1717
rules: {
18+
'prefer-const': ['error', { destructuring: 'all' }],
19+
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
1820
'@typescript-eslint/ban-ts-comment': 'off',
1921
'@typescript-eslint/no-unused-vars': 'off',
2022
'@typescript-eslint/no-floating-promises': 'off',
2123
'@typescript-eslint/restrict-template-expressions': [
2224
'error',
2325
{ allowAny: true },
2426
],
25-
'jsdoc/no-types': 'warn',
27+
'tsdoc/syntax': 'warn',
2628
},
2729
};

config/vue-overrides.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)