@studio/eslint-config 1.1.1 → 2.3.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/CHANGES.md +56 -15
- package/README.md +1 -5
- package/index.js +115 -73
- package/package.json +12 -5
package/CHANGES.md
CHANGED
|
@@ -1,25 +1,66 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
- 🍏 [`bed55ec`](https://github.com/javascript-studio/eslint-config/commit/bed55ec462bab33db91990721e69201b00c598b6)
|
|
6
|
+
Allow eslint-plugin-mocha ^10
|
|
7
|
+
- 🍏 [`361aeee`](https://github.com/javascript-studio/eslint-config/commit/361aeee06d6f2bb3e86fad0c5477a30d21ddb21c)
|
|
8
|
+
Support eslint 8
|
|
9
|
+
- 🛡 [`28d99ca`](https://github.com/javascript-studio/eslint-config/commit/28d99ca887617c33f82e19370a5904a24f086608)
|
|
10
|
+
npm audit
|
|
11
|
+
- ✨ [`41e0198`](https://github.com/javascript-studio/eslint-config/commit/41e01980b22034569bac376808a20ba604f4f90b)
|
|
12
|
+
Add test script to lint the linter config
|
|
13
|
+
|
|
14
|
+
_Released by [Maximilian Antoni](https://github.com/mantoni) on 2022-01-05._
|
|
15
|
+
|
|
16
|
+
## 2.2.0
|
|
17
|
+
|
|
18
|
+
- 🍏 [`c4a37e7`](https://github.com/javascript-studio/eslint-config/commit/c4a37e7ed4743d91de1f0fb7386917fa66351b82)
|
|
19
|
+
Declare `**/*.integration.js` pattern as mocha env
|
|
20
|
+
|
|
21
|
+
_Released by [Maximilian Antoni](https://github.com/mantoni) on 2021-07-27._
|
|
22
|
+
|
|
23
|
+
## 2.1.0
|
|
24
|
+
|
|
25
|
+
- 🍏 [`9b034bf`](https://github.com/javascript-studio/eslint-config/commit/9b034bf159367e054c4b44e9987e9fd88b961deb)
|
|
26
|
+
Add `eslint-plugin-mocha` v9 compatibility
|
|
27
|
+
- 🛡 [`ea0686c`](https://github.com/javascript-studio/eslint-config/commit/ea0686c7948411fb7a14343232eaf886a70b5987)
|
|
28
|
+
Bump hosted-git-info from 3.0.4 to 3.0.8 (dependabot[bot])
|
|
29
|
+
- 📚 [`c1ed531`](https://github.com/javascript-studio/eslint-config/commit/c1ed531d7b0fa6e309a7f1939ce9ad5ecb3306d5)
|
|
30
|
+
Rename project to remove studio prefix
|
|
31
|
+
- 📚 [`630b341`](https://github.com/javascript-studio/eslint-config/commit/630b341564b9d16618a6ee55eadea69d251b661b)
|
|
32
|
+
Update install instructions
|
|
33
|
+
- ✨ [`2b6b0b4`](https://github.com/javascript-studio/eslint-config/commit/2b6b0b4b819b11476f0fc6deb1c8b30a6bb422f1)
|
|
34
|
+
Update Studio Changes
|
|
35
|
+
- ✨ [`2d3a2b8`](https://github.com/javascript-studio/eslint-config/commit/2d3a2b80c61fd4215cc59931864b7a8e0f789d89)
|
|
36
|
+
Use npm 7
|
|
37
|
+
- ✨ [`854bcd2`](https://github.com/javascript-studio/eslint-config/commit/854bcd21cad1c25ecea20e95a11bfafaf016e2e9)
|
|
38
|
+
Add .gitignore
|
|
39
|
+
|
|
40
|
+
_Released by [Maximilian Antoni](https://github.com/mantoni) on 2021-07-08._
|
|
41
|
+
|
|
42
|
+
## 2.0.0
|
|
43
|
+
|
|
44
|
+
- [`087bb93`](https://github.com/javascript-studio/eslint-config/commit/087bb9337644a279f6a34d1bb5e513b4fa4dc148)
|
|
45
|
+
Rewrite config and dependencies (#7)
|
|
46
|
+
>
|
|
47
|
+
> - Add node plugin and use recomended settings
|
|
48
|
+
> - Drop prettier integration with eslint
|
|
49
|
+
> - Rework mocha rules
|
|
50
|
+
> - Review all rules
|
|
51
|
+
> - Remove formatting related rules to avoid conflicts with prettier
|
|
52
|
+
|
|
53
|
+
_Released by [Maximilian Antoni](https://github.com/mantoni) on 2020-11-22._
|
|
54
|
+
|
|
3
55
|
## 1.1.1
|
|
4
56
|
|
|
5
|
-
-
|
|
57
|
+
- [`2ec0549`](https://github.com/javascript-studio/eslint-config/commit/2ec0549a3bca5b5d89e9089b440949bcab23af87)
|
|
58
|
+
Fix syntax errors (Morgan Roderick)
|
|
6
59
|
|
|
7
60
|
## 1.1.0
|
|
8
61
|
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
> Function declarations are hoisted, so early use of functions (before
|
|
12
|
-
> they're declared) is safe.
|
|
13
|
-
>
|
|
14
|
-
> This allows organisation of code to read like a newspaper article, i.e.
|
|
15
|
-
> from higher to lower abstraction level, which is recommended by people
|
|
16
|
-
> like Robert C. Martin (Clean Code) and Kent C. Dodds.
|
|
17
|
-
>
|
|
18
|
-
> See:
|
|
19
|
-
> * https://eslint.org/docs/rules/no-use-before-define#options
|
|
20
|
-
> * https://books.google.es/books?id=_i6bDeoCQzsC&pg=PA136&lpg=PA136&dq=code+read+like+a+newspaper+article&source=bl&ots=epaNGi4a19&sig=ACfU3U1J0a7UzLLelJBJVgfENXgKxfNalw&hl=en&sa=X&ved=2ahUKEwjTkOfsv5LoAhWiyoUKHdlgAeEQ6AEwAnoECAoQAQ#v=onepage&q=code%20read%20like%20a%20newspaper%20article&f=false
|
|
21
|
-
> * https://kentcdodds.com/blog/newspaper-code-structure
|
|
22
|
-
>
|
|
62
|
+
- [`3d0a3bc`](https://github.com/javascript-studio/eslint-config/commit/3d0a3bcdb80bd1fb5652a62cbcd39eea6d801a2c)
|
|
63
|
+
Allow early use of functions (Morgan Roderick)
|
|
23
64
|
|
|
24
65
|
## 1.0.2
|
|
25
66
|
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ The [sharable eslint config][docs] for all JavaScript Studio projects.
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
$ npm install @studio/eslint-config eslint --save-dev
|
|
8
|
+
$ npm install @studio/eslint-config eslint eslint-plugin-mocha eslint-plugin-node --save-dev
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -16,10 +16,6 @@ Make sure this is in your `package.json`:
|
|
|
16
16
|
{
|
|
17
17
|
"eslintConfig": {
|
|
18
18
|
"extends": "@studio"
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@studio/eslint-config": "^1.0.0",
|
|
22
|
-
"eslint": "^3.3.0"
|
|
23
19
|
}
|
|
24
20
|
}
|
|
25
21
|
```
|
package/index.js
CHANGED
|
@@ -14,101 +14,143 @@ module.exports = {
|
|
|
14
14
|
es6: true
|
|
15
15
|
},
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
plugins: [
|
|
18
|
+
'mocha'
|
|
19
|
+
],
|
|
18
20
|
|
|
21
|
+
extends: [
|
|
22
|
+
'eslint:recommended',
|
|
23
|
+
'plugin:node/recommended'
|
|
24
|
+
],
|
|
25
|
+
|
|
26
|
+
overrides: [{
|
|
27
|
+
files: [
|
|
28
|
+
'**/*.test.js',
|
|
29
|
+
'**/*-test.js',
|
|
30
|
+
'**/*.integration.js'
|
|
31
|
+
],
|
|
32
|
+
env: {
|
|
33
|
+
mocha: true
|
|
34
|
+
}
|
|
35
|
+
}],
|
|
36
|
+
|
|
37
|
+
// Formatting should be handled by prettier.
|
|
19
38
|
rules: {
|
|
20
|
-
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'no-
|
|
24
|
-
'no-
|
|
25
|
-
'
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
39
|
+
// https://github.com/lo1tuma/eslint-plugin-mocha
|
|
40
|
+
'mocha/no-async-describe': 2,
|
|
41
|
+
'mocha/no-exclusive-tests': 2,
|
|
42
|
+
'mocha/no-identical-title': 2,
|
|
43
|
+
'mocha/no-return-and-callback': 2,
|
|
44
|
+
'mocha/prefer-arrow-callback': 2,
|
|
45
|
+
|
|
46
|
+
// https://github.com/mysticatea/eslint-plugin-node
|
|
47
|
+
'node/handle-callback-err': 2,
|
|
48
|
+
'node/no-callback-literal': 2,
|
|
49
|
+
'node/no-new-require': 2,
|
|
50
|
+
'node/global-require': 2,
|
|
51
|
+
'node/no-mixed-requires': 2,
|
|
52
|
+
'node/no-sync': 2,
|
|
53
|
+
'node/prefer-global/buffer': 2,
|
|
54
|
+
'node/prefer-global/console': 2,
|
|
55
|
+
'node/prefer-global/process': 2,
|
|
56
|
+
'node/prefer-global/text-decoder': 2,
|
|
57
|
+
'node/prefer-global/text-encoder': 2,
|
|
58
|
+
'node/prefer-global/url-search-params': 2,
|
|
59
|
+
'node/prefer-global/url': 2,
|
|
60
|
+
// node default tweaks
|
|
61
|
+
'node/no-unpublished-require': 0, // fails for @sinonjs/referee-sinon
|
|
62
|
+
'node/no-missing-require': [2, {
|
|
63
|
+
'tryExtensions': ['.js', '.json']
|
|
64
|
+
}],
|
|
65
|
+
'node/shebang': 0,
|
|
66
|
+
'no-process-exit': 0,
|
|
33
67
|
|
|
34
|
-
|
|
68
|
+
// eslint default tweaks
|
|
69
|
+
'no-unused-vars': [2, { args: 'after-used', argsIgnorePattern: '^_' }],
|
|
70
|
+
|
|
71
|
+
// Possible Errors (not in recommended)
|
|
72
|
+
'no-template-curly-in-string': 2,
|
|
73
|
+
'no-unreachable-loop': 2,
|
|
74
|
+
'no-useless-backreference': 2,
|
|
75
|
+
'require-atomic-updates': 2,
|
|
76
|
+
|
|
77
|
+
// Best Practices (not in recommended)
|
|
78
|
+
'array-callback-return': 2,
|
|
35
79
|
'block-scoped-var': 2,
|
|
36
|
-
'
|
|
37
|
-
'brace-style': [2, '1tbs', { allowSingleLine: true }],
|
|
38
|
-
'comma-spacing': [2, { before: false, after: true }],
|
|
39
|
-
'comma-style': [2, 'last'],
|
|
80
|
+
'complexity': 2,
|
|
40
81
|
'consistent-return': 2,
|
|
41
|
-
curly: 2,
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
|
|
45
|
-
'
|
|
82
|
+
'curly': 2,
|
|
83
|
+
'default-case': 2,
|
|
84
|
+
'default-case-last': 2,
|
|
85
|
+
'default-param-last': 2,
|
|
86
|
+
'eqeqeq': 2,
|
|
46
87
|
'guard-for-in': 2,
|
|
47
|
-
indent: ['error', 2, {
|
|
48
|
-
FunctionDeclaration: {
|
|
49
|
-
parameters: 2,
|
|
50
|
-
body: 1
|
|
51
|
-
},
|
|
52
|
-
FunctionExpression: {
|
|
53
|
-
parameters: 2,
|
|
54
|
-
body: 1
|
|
55
|
-
}
|
|
56
|
-
}],
|
|
57
|
-
'linebreak-style': [2, 'unix'],
|
|
58
|
-
'max-len': [2, 80, 4],
|
|
59
|
-
'new-cap': 2,
|
|
60
|
-
'new-parens': 2,
|
|
61
88
|
'no-alert': 2,
|
|
62
89
|
'no-caller': 2,
|
|
63
|
-
'no-
|
|
64
|
-
'no-console': 0,
|
|
90
|
+
'no-constructor-return': 2,
|
|
65
91
|
'no-else-return': 2,
|
|
66
92
|
'no-eq-null': 2,
|
|
67
93
|
'no-eval': 2,
|
|
68
|
-
'no-extend-native':
|
|
94
|
+
'no-extend-native': 2,
|
|
69
95
|
'no-extra-bind': 2,
|
|
96
|
+
'no-extra-label': 2,
|
|
97
|
+
'no-floating-decimal': 2,
|
|
98
|
+
'no-implicit-coercion': 2,
|
|
70
99
|
'no-implied-eval': 2,
|
|
71
|
-
'no-
|
|
100
|
+
'no-iterator': 2,
|
|
101
|
+
'no-lone-blocks': 2,
|
|
72
102
|
'no-loop-func': 2,
|
|
73
|
-
'no-
|
|
103
|
+
'no-new': 2,
|
|
74
104
|
'no-new-func': 2,
|
|
75
105
|
'no-new-wrappers': 2,
|
|
76
|
-
'no-
|
|
106
|
+
'no-octal-escape': 2,
|
|
107
|
+
'no-proto': 2,
|
|
108
|
+
'no-restricted-properties': 2,
|
|
77
109
|
'no-return-assign': 2,
|
|
110
|
+
'no-return-await': 2,
|
|
78
111
|
'no-self-compare': 2,
|
|
79
|
-
'no-
|
|
80
|
-
'no-sync': 2,
|
|
112
|
+
'no-sequences': 2,
|
|
81
113
|
'no-throw-literal': 2,
|
|
82
|
-
'no-
|
|
83
|
-
'no-undef-init': 2,
|
|
84
|
-
'no-unneeded-ternary': 2,
|
|
114
|
+
'no-unmodified-loop-condition': 2,
|
|
85
115
|
'no-unused-expressions': 2,
|
|
86
|
-
'no-unused-vars': [2, { args: 'after-used', argsIgnorePattern: '^_' }],
|
|
87
|
-
'no-use-before-define': ['error', { 'functions': false, 'classes': true }],
|
|
88
116
|
'no-useless-call': 2,
|
|
89
117
|
'no-useless-concat': 2,
|
|
118
|
+
'no-useless-return': 2,
|
|
90
119
|
'no-void': 2,
|
|
91
|
-
'
|
|
92
|
-
'
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
'
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
'
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
|
|
111
|
-
'
|
|
112
|
-
|
|
120
|
+
'prefer-promise-reject-errors': 2,
|
|
121
|
+
'prefer-regex-literals': 2,
|
|
122
|
+
'radix': 2,
|
|
123
|
+
'require-await': 2,
|
|
124
|
+
'yoda': 2,
|
|
125
|
+
'strict': 2,
|
|
126
|
+
|
|
127
|
+
// Variables
|
|
128
|
+
'no-label-var': 2,
|
|
129
|
+
'no-restricted-globals': 2,
|
|
130
|
+
'no-shadow': 2,
|
|
131
|
+
'no-use-before-define': [2, "nofunc"],
|
|
132
|
+
|
|
133
|
+
// Stylistic Issues
|
|
134
|
+
'comma-dangle': 2,
|
|
135
|
+
'max-depth': 2,
|
|
136
|
+
'max-nested-callbacks': 2,
|
|
137
|
+
'new-cap': 2,
|
|
138
|
+
'new-parens': 2,
|
|
139
|
+
'no-array-constructor': 2,
|
|
140
|
+
'no-lonely-if': 2,
|
|
141
|
+
'no-new-object': 2,
|
|
142
|
+
'no-unneeded-ternary': 2,
|
|
143
|
+
'semi': 2,
|
|
144
|
+
|
|
145
|
+
// ECMAScript 6
|
|
146
|
+
'no-useless-computed-key': 2,
|
|
147
|
+
'no-useless-constructor': 2,
|
|
148
|
+
'no-useless-rename': 2,
|
|
149
|
+
'no-var': 2,
|
|
150
|
+
'object-shorthand': 2,
|
|
151
|
+
'prefer-arrow-callback': 2,
|
|
152
|
+
'prefer-const': 2,
|
|
153
|
+
'prefer-spread': 2,
|
|
154
|
+
'prefer-template': 2
|
|
113
155
|
}
|
|
114
156
|
};
|
package/package.json
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studio/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "The JavaScript Studio sharable eslint config",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Maximilian Antoni <max@javascript.studio>",
|
|
7
|
-
"homepage": "https://github.com/javascript-studio/
|
|
7
|
+
"homepage": "https://github.com/javascript-studio/eslint-config",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"
|
|
9
|
+
"test": "eslint --config index.js index.js",
|
|
10
|
+
"preversion": "npm test",
|
|
11
|
+
"version": "changes --commits --footer",
|
|
10
12
|
"postversion": "git push --follow-tags && npm publish"
|
|
11
13
|
},
|
|
12
14
|
"devDependencies": {
|
|
13
|
-
"@studio/changes": "^2.
|
|
15
|
+
"@studio/changes": "^2.2.0"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"eslint": "^7 || ^8",
|
|
19
|
+
"eslint-plugin-mocha": "^8 || ^9 || ^10",
|
|
20
|
+
"eslint-plugin-node": "^11"
|
|
14
21
|
},
|
|
15
22
|
"repository": {
|
|
16
23
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/javascript-studio/
|
|
24
|
+
"url": "https://github.com/javascript-studio/eslint-config.git"
|
|
18
25
|
},
|
|
19
26
|
"license": "MIT"
|
|
20
27
|
}
|