@tpluscode/eslint-config 0.3.2 → 0.3.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/CHANGELOG.md +12 -0
- package/README.md +24 -6
- package/index.js +5 -46
- package/js.js +57 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 191763b: Added a base config for JS-only projects
|
|
8
|
+
|
|
9
|
+
## 0.3.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- d57dc1e: Standard `no-redeclare` would show incorrect errors about function overloads
|
|
14
|
+
|
|
3
15
|
## 0.3.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
# @tpluscode/eslint-config
|
|
2
2
|
|
|
3
|
-
Slightly customized `standard` config
|
|
3
|
+
Slightly customized `standard` config.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
+
For JS project:
|
|
8
|
+
|
|
7
9
|
```
|
|
8
10
|
npm i --save-dev \
|
|
9
11
|
@tpluscode/eslint-config \
|
|
10
|
-
@typescript-eslint/eslint-plugin \
|
|
11
|
-
@typescript-eslint/parser \
|
|
12
|
-
eslint-import-resolver-typescript \
|
|
13
12
|
eslint-config-standard \
|
|
14
13
|
eslint-plugin-import \
|
|
15
14
|
eslint-plugin-node \
|
|
15
|
+
eslint-plugin-promise \
|
|
16
|
+
eslint-plugin-n \
|
|
16
17
|
standard
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
If you write code in TypeScript, add:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
npm i --save-dev \
|
|
24
|
+
@typescript-eslint/eslint-plugin \
|
|
25
|
+
@typescript-eslint/parser \
|
|
26
|
+
eslint-import-resolver-typescript
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## eslint config
|
|
30
|
+
|
|
31
|
+
In a JavaScript project:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"extends": [ "@tpluscode/eslint-config/js" ]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
20
38
|
|
|
21
|
-
In
|
|
39
|
+
In a TypeScript project:
|
|
22
40
|
|
|
23
41
|
```json
|
|
24
42
|
{
|
package/index.js
CHANGED
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
extends: [
|
|
3
3
|
'plugin:@typescript-eslint/recommended',
|
|
4
|
-
'
|
|
5
|
-
'plugin:import/errors',
|
|
6
|
-
'plugin:import/warnings',
|
|
4
|
+
'./js.js',
|
|
7
5
|
'plugin:import/typescript'
|
|
8
6
|
],
|
|
9
7
|
parserOptions: {
|
|
10
8
|
parser: '@typescript-eslint/parser'
|
|
11
9
|
},
|
|
12
10
|
plugins: [
|
|
13
|
-
'@typescript-eslint/eslint-plugin'
|
|
14
|
-
'import'
|
|
11
|
+
'@typescript-eslint/eslint-plugin'
|
|
15
12
|
],
|
|
16
13
|
rules: {
|
|
17
14
|
indent: 'off',
|
|
18
|
-
'no-console': 'error',
|
|
19
|
-
'import/no-unresolved': 'error',
|
|
20
|
-
'import/extensions': 'off',
|
|
21
|
-
'import/order': 'error',
|
|
22
|
-
'space-before-function-paren': [
|
|
23
|
-
'error',
|
|
24
|
-
{
|
|
25
|
-
named: 'never'
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
'comma-dangle': [
|
|
29
|
-
'error',
|
|
30
|
-
'always-multiline'
|
|
31
|
-
],
|
|
32
15
|
'@typescript-eslint/indent': ['error', 2],
|
|
33
16
|
'@typescript-eslint/member-delimiter-style': [
|
|
34
17
|
'error',
|
|
@@ -38,25 +21,12 @@ module.exports = {
|
|
|
38
21
|
}
|
|
39
22
|
}
|
|
40
23
|
],
|
|
41
|
-
'import/no-extraneous-dependencies': [
|
|
42
|
-
'error',
|
|
43
|
-
{
|
|
44
|
-
devDependencies: [
|
|
45
|
-
'**/test/**/*.ts',
|
|
46
|
-
'*.test.ts',
|
|
47
|
-
'*.spec.ts',
|
|
48
|
-
'**/test/**/*.js',
|
|
49
|
-
'*.test.js',
|
|
50
|
-
'*.spec.js'
|
|
51
|
-
],
|
|
52
|
-
optionalDependencies: false
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
24
|
'no-dupe-class-members': 'off',
|
|
56
|
-
'@typescript-eslint/no-dupe-class-members': ['error']
|
|
25
|
+
'@typescript-eslint/no-dupe-class-members': ['error'],
|
|
26
|
+
'no-redeclare': 'off',
|
|
27
|
+
'@typescript-eslint/no-redeclare': 'warn'
|
|
57
28
|
},
|
|
58
29
|
settings: {
|
|
59
|
-
'import/core-modules': ['rdf-js'],
|
|
60
30
|
'import/parsers': {
|
|
61
31
|
'@typescript-eslint/parser': ['.ts', '.tsx']
|
|
62
32
|
},
|
|
@@ -76,17 +46,6 @@ module.exports = {
|
|
|
76
46
|
'@typescript-eslint/no-var-requires': 'off'
|
|
77
47
|
}
|
|
78
48
|
},
|
|
79
|
-
{
|
|
80
|
-
files: [
|
|
81
|
-
'*.test.js',
|
|
82
|
-
'*.spec.js',
|
|
83
|
-
'*.test.ts',
|
|
84
|
-
'*.spec.ts'
|
|
85
|
-
],
|
|
86
|
-
rules: {
|
|
87
|
-
'no-unused-expressions': 'off'
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
49
|
{
|
|
91
50
|
files: '*.ts',
|
|
92
51
|
rules: {
|
package/js.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'standard',
|
|
4
|
+
'plugin:import/errors',
|
|
5
|
+
'plugin:import/warnings'
|
|
6
|
+
],
|
|
7
|
+
plugins: [
|
|
8
|
+
'import'
|
|
9
|
+
],
|
|
10
|
+
rules: {
|
|
11
|
+
indent: ['error', 2],
|
|
12
|
+
'no-console': 'error',
|
|
13
|
+
'import/no-unresolved': 'error',
|
|
14
|
+
'import/extensions': 'off',
|
|
15
|
+
'import/order': 'error',
|
|
16
|
+
'space-before-function-paren': [
|
|
17
|
+
'error',
|
|
18
|
+
{
|
|
19
|
+
named: 'never'
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
'comma-dangle': [
|
|
23
|
+
'error',
|
|
24
|
+
'always-multiline'
|
|
25
|
+
],
|
|
26
|
+
'import/no-extraneous-dependencies': [
|
|
27
|
+
'error',
|
|
28
|
+
{
|
|
29
|
+
devDependencies: [
|
|
30
|
+
'**/test/**/*.ts',
|
|
31
|
+
'*.test.ts',
|
|
32
|
+
'*.spec.ts',
|
|
33
|
+
'**/test/**/*.js',
|
|
34
|
+
'*.test.js',
|
|
35
|
+
'*.spec.js'
|
|
36
|
+
],
|
|
37
|
+
optionalDependencies: false
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
settings: {
|
|
42
|
+
'import/core-modules': ['rdf-js']
|
|
43
|
+
},
|
|
44
|
+
overrides: [
|
|
45
|
+
{
|
|
46
|
+
files: [
|
|
47
|
+
'*.test.js',
|
|
48
|
+
'*.spec.js',
|
|
49
|
+
'*.test.ts',
|
|
50
|
+
'*.spec.ts'
|
|
51
|
+
],
|
|
52
|
+
rules: {
|
|
53
|
+
'no-unused-expressions': 'off'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|