eslint-config-gristow 1.0.34 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -43
- package/package.json +3 -3
- package/svelte.eslintrc.js +59 -0
package/.eslintrc.js
CHANGED
|
@@ -6,7 +6,7 @@ const prettierRules = require('./prettier-rules');
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
parser: '@babel/eslint-parser',
|
|
8
8
|
parserOptions: {
|
|
9
|
-
ecmaVersion:
|
|
9
|
+
ecmaVersion: 2022,
|
|
10
10
|
project: ['./tsconfig.json'],
|
|
11
11
|
allowAutomaticSingleRunInference: true,
|
|
12
12
|
// Can I remove these now?
|
|
@@ -16,48 +16,8 @@ module.exports = {
|
|
|
16
16
|
},
|
|
17
17
|
requireConfigFile: false,
|
|
18
18
|
},
|
|
19
|
+
extends: ['plugin:svelte/recommended'],
|
|
19
20
|
overrides: [
|
|
20
|
-
{
|
|
21
|
-
files: ['*.svelte'],
|
|
22
|
-
plugins: ['svelte3', '@typescript-eslint', 'eslint-plugin-tsdoc'],
|
|
23
|
-
processor: 'svelte3/svelte3',
|
|
24
|
-
extends: ['airbnb-typescript/base'],
|
|
25
|
-
rules: {
|
|
26
|
-
...rules,
|
|
27
|
-
/**
|
|
28
|
-
* eslint-plugin-svelte3 has issues, basically, with any eslint fix that creates a
|
|
29
|
-
* multi-line fix. So, lots has to be disabled... even so, I'm sure I've missed some
|
|
30
|
-
* see https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/OTHER_PLUGINS.md
|
|
31
|
-
*/
|
|
32
|
-
'import/first': 'off',
|
|
33
|
-
'import/no-cycle': 'off',
|
|
34
|
-
'import/no-duplicates': 'off',
|
|
35
|
-
'import/no-mutable-exports': 'off',
|
|
36
|
-
'import/no-unresolved': 'off',
|
|
37
|
-
'import/no-useless-path-segments': 'off',
|
|
38
|
-
// Prettier will add an empty line before end of </script> so this has to be off.
|
|
39
|
-
'no-multiple-empty-lines': 'off',
|
|
40
|
-
// Prettier will sometimes add a new line after =, so disable this:
|
|
41
|
-
'operator-linebreak': 'off',
|
|
42
|
-
'@typescript-eslint/indent': 'off',
|
|
43
|
-
'@typescript-eslint/no-var-requires': 'warn',
|
|
44
|
-
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
|
|
45
|
-
'no-useless-constructor': 'off',
|
|
46
|
-
// no-dupe-class-members should be removed when this PR lands:
|
|
47
|
-
// https://github.com/typescript-eslint/typescript-eslint/pull/1492
|
|
48
|
-
'no-dupe-class-members': 'off',
|
|
49
|
-
// So we can allow overloading, and list of class props defined
|
|
50
|
-
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
51
|
-
'@typescript-eslint/no-useless-constructor': 'error',
|
|
52
|
-
'tsdoc/syntax': 'warn',
|
|
53
|
-
// We get these via TS checking, and w/ import type we might have 2 entries,
|
|
54
|
-
// one for named, one for default, one for actual import.
|
|
55
|
-
'no-duplicate-imports': 'off',
|
|
56
|
-
},
|
|
57
|
-
settings: {
|
|
58
|
-
'svelte3/typescript': require('typescript'),
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
21
|
{
|
|
62
22
|
files: ['*.js'],
|
|
63
23
|
plugins: ['prettier', 'jsdoc'],
|
|
@@ -118,7 +78,6 @@ module.exports = {
|
|
|
118
78
|
jsdoc: {
|
|
119
79
|
mode: 'typescript',
|
|
120
80
|
},
|
|
121
|
-
'svelte3/ignore-styles': () => true,
|
|
122
81
|
},
|
|
123
82
|
},
|
|
124
83
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-gristow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.36",
|
|
4
4
|
"description": "Eslint settings for Greg Ristow",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"eslint-plugin-prettier": "^3.4.0",
|
|
43
43
|
"eslint-plugin-react": "^7.24.0",
|
|
44
44
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
45
|
-
"eslint-plugin-
|
|
45
|
+
"eslint-plugin-svelte": "^2.28.0",
|
|
46
46
|
"eslint-plugin-tsdoc": "^0.2.14",
|
|
47
47
|
"prettier": "^2.3.2"
|
|
48
48
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"eslint-plugin-prettier": "^3.4.0",
|
|
63
63
|
"eslint-plugin-react": "^7.24.0",
|
|
64
64
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
65
|
-
"eslint-plugin-
|
|
65
|
+
"eslint-plugin-svelte": "^2.28.0",
|
|
66
66
|
"eslint-plugin-tsdoc": "^0.2.14",
|
|
67
67
|
"prettier": "^2.3.2",
|
|
68
68
|
"typescript": "*"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// See https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/ROADMAP.md for tslint-eslint rule migration
|
|
2
|
+
|
|
3
|
+
const rules = require('./shared-rules');
|
|
4
|
+
const prettierRules = require('./prettier-rules');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
parser: '@babel/eslint-parser',
|
|
8
|
+
parserOptions: {
|
|
9
|
+
ecmaVersion: 2022,
|
|
10
|
+
project: ['./tsconfig.json'],
|
|
11
|
+
allowAutomaticSingleRunInference: true,
|
|
12
|
+
// Can I remove these now?
|
|
13
|
+
ecmaFeatures: {
|
|
14
|
+
impliedStrict: true,
|
|
15
|
+
classes: true,
|
|
16
|
+
},
|
|
17
|
+
requireConfigFile: false,
|
|
18
|
+
},
|
|
19
|
+
extends: ['plugin:svelte/recommended', './.eslintrc.js'],
|
|
20
|
+
overrides: [
|
|
21
|
+
{
|
|
22
|
+
files: ['*.svelte'],
|
|
23
|
+
plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
|
|
24
|
+
extends: ['airbnb-typescript/base'],
|
|
25
|
+
rules: {
|
|
26
|
+
...rules,
|
|
27
|
+
/**
|
|
28
|
+
* eslint-plugin-svelte3 has issues, basically, with any eslint fix that creates a
|
|
29
|
+
* multi-line fix. So, lots has to be disabled... even so, I'm sure I've missed some
|
|
30
|
+
* see https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/OTHER_PLUGINS.md
|
|
31
|
+
*/
|
|
32
|
+
'import/first': 'off',
|
|
33
|
+
'import/no-cycle': 'off',
|
|
34
|
+
'import/no-duplicates': 'off',
|
|
35
|
+
'import/no-mutable-exports': 'off',
|
|
36
|
+
'import/no-unresolved': 'off',
|
|
37
|
+
'import/no-useless-path-segments': 'off',
|
|
38
|
+
// Prettier will add an empty line before end of </script> so this has to be off.
|
|
39
|
+
'no-multiple-empty-lines': 'off',
|
|
40
|
+
// Prettier will sometimes add a new line after =, so disable this:
|
|
41
|
+
'operator-linebreak': 'off',
|
|
42
|
+
'@typescript-eslint/indent': 'off',
|
|
43
|
+
'@typescript-eslint/no-var-requires': 'warn',
|
|
44
|
+
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
|
|
45
|
+
'no-useless-constructor': 'off',
|
|
46
|
+
// no-dupe-class-members should be removed when this PR lands:
|
|
47
|
+
// https://github.com/typescript-eslint/typescript-eslint/pull/1492
|
|
48
|
+
'no-dupe-class-members': 'off',
|
|
49
|
+
// So we can allow overloading, and list of class props defined
|
|
50
|
+
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
51
|
+
'@typescript-eslint/no-useless-constructor': 'error',
|
|
52
|
+
'tsdoc/syntax': 'warn',
|
|
53
|
+
// We get these via TS checking, and w/ import type we might have 2 entries,
|
|
54
|
+
// one for named, one for default, one for actual import.
|
|
55
|
+
'no-duplicate-imports': 'off',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|