@alexlit/config-eslint 67.0.44 → 69.0.0
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/README.md +69 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# ESLint Configuration
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm i @alexlit/config-eslint -D
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Connection
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
// .eslintrc.js
|
|
13
|
+
module.exports = {
|
|
14
|
+
...require('@alexlit/config-eslint'),
|
|
15
|
+
};
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Recipes
|
|
19
|
+
|
|
20
|
+
### Vue
|
|
21
|
+
|
|
22
|
+
- If you use vue.js with `options api` syntax you need to turn off `sort-keys`
|
|
23
|
+
rule for `*.vue` files
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
// .eslintrc.js
|
|
27
|
+
overrides: [
|
|
28
|
+
{
|
|
29
|
+
files: ['*.vue'],
|
|
30
|
+
rules: {
|
|
31
|
+
'sort-keys': 'off',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Spell check
|
|
38
|
+
|
|
39
|
+
- Skip some words
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
// .eslintrc.js
|
|
43
|
+
const SPELLCHECK_RULES = require('@alexlit/config-eslint/plugins/spellcheck')
|
|
44
|
+
.rules['spellcheck/spell-checker'][1];
|
|
45
|
+
|
|
46
|
+
module.exports = {
|
|
47
|
+
rules: {
|
|
48
|
+
'spellcheck/spell-checker': [
|
|
49
|
+
'warn',
|
|
50
|
+
{
|
|
51
|
+
...SPELLCHECK_RULES,
|
|
52
|
+
|
|
53
|
+
skipWords: [...SPELLCHECK_RULES.skipWords, 'word1', 'word2'],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- Disable spell checking
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
// .eslintrc.js
|
|
64
|
+
module.exports = {
|
|
65
|
+
rules: {
|
|
66
|
+
'spellcheck/spell-checker': 'off',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
```
|