eslint-config-gristow 2.0.2 → 2.0.4
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/package.json +1 -1
- package/readme.md +9 -14
- package/rules/shared-rules.cjs +11 -1
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -62,7 +62,9 @@ Once you have the above installed, you probably want your editor to lint and fix
|
|
|
62
62
|
1. Install the [ESLint package](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
63
63
|
|
|
64
64
|
2. Now we need to setup some VS Code settings via `Code/File` → `Preferences` → `Settings`. It's easier to enter these settings while editing the `settings.json` file, so click the `{}` icon in the top right corner:
|
|
65
|
-
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
66
68
|
"[javascript]": {
|
|
67
69
|
"editor.codeActionsOnSave": {
|
|
68
70
|
"source.fixAll.eslint": true
|
|
@@ -74,23 +76,16 @@ Once you have the above installed, you probably want your editor to lint and fix
|
|
|
74
76
|
}
|
|
75
77
|
},
|
|
76
78
|
"[svelte]": {
|
|
79
|
+
"editor.defaultFormatter": "svelte.svelte-vscode",
|
|
77
80
|
"editor.formatOnSave": true,
|
|
78
81
|
"editor.codeActionsOnSave": {
|
|
79
82
|
"source.fixAll.eslint": true
|
|
80
83
|
}
|
|
81
84
|
},
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"eslint.validate": [
|
|
91
|
-
"javascript",
|
|
92
|
-
"typescript",
|
|
93
|
-
"svelte"
|
|
94
|
-
]
|
|
85
|
+
// This line is CRITICAL for enabling eslint checking of svelte files,
|
|
86
|
+
// otherwise they are ignored by default (despite the above!)
|
|
87
|
+
"eslint.validate": ["javascript", "typescript", "svelte"],
|
|
88
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
89
|
+
"editor.formatOnSave": true
|
|
95
90
|
}
|
|
96
91
|
```
|
package/rules/shared-rules.cjs
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
* These rules are shared by both .js and .ts
|
|
3
3
|
*/
|
|
4
4
|
module.exports = {
|
|
5
|
-
'no-unused
|
|
5
|
+
// We disable eslint's no-unused vars, and enable typescript's because
|
|
6
|
+
// otherwise local vars listed in function overloads are flagged.
|
|
7
|
+
'no-unused-vars': 'off',
|
|
8
|
+
'@typescript-eslint/no-unused-vars': 'error',
|
|
9
|
+
|
|
10
|
+
// We disable eslint's no-unused vars, and enable typescript's because
|
|
11
|
+
'default-param-last': 'off',
|
|
12
|
+
'@typescript-eslint/default-param-last': 'error',
|
|
13
|
+
|
|
6
14
|
'no-unreachable': 'error',
|
|
7
15
|
'no-use-before-define': ['error', { functions: false }],
|
|
8
16
|
// '@-define': ['error', { functions: false }],
|
|
@@ -72,4 +80,6 @@ module.exports = {
|
|
|
72
80
|
// Conflicts w/ prettier:
|
|
73
81
|
'object-curly-newline': 'off',
|
|
74
82
|
'operator-linebreak': 'off',
|
|
83
|
+
'implicit-arrow-linebreak': 'off',
|
|
84
|
+
'function-paren-newline': 'off',
|
|
75
85
|
};
|