eslint-config-adslot 1.0.1 → 1.2.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 +15 -3
- package/index.js +11 -6
- package/package.json +14 -14
package/README.md
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# eslint-config-adslot
|
2
2
|
|
3
3
|
[](https://badge.fury.io/js/eslint-config-adslot)
|
4
|
-
|
4
|
+

|
5
5
|
|
6
6
|
ESLint configuration for Adslot
|
7
7
|
|
8
8
|
## Install
|
9
9
|
|
10
10
|
```
|
11
|
-
npm install -D eslint-config-adslot babel-
|
11
|
+
npm install -D eslint-config-adslot @babel/eslint-parser eslint
|
12
12
|
```
|
13
13
|
|
14
|
-
`eslint` and
|
14
|
+
`eslint` and `@babel/eslint-parser` are both required peer dependencies
|
15
15
|
|
16
16
|
## Setup
|
17
17
|
|
@@ -23,6 +23,18 @@ Add the following to your eslint config file, ususally `.eslintrc`,
|
|
23
23
|
}
|
24
24
|
```
|
25
25
|
|
26
|
+
## Babel config
|
27
|
+
|
28
|
+
When not using `babel.config.js` in project root direct, add the following to `eslintrc` file.
|
29
|
+
|
30
|
+
```
|
31
|
+
parserOptions: {
|
32
|
+
babelOptions: {
|
33
|
+
configFile: 'path/to/babelrc',
|
34
|
+
},
|
35
|
+
}
|
36
|
+
```
|
37
|
+
|
26
38
|
## Features
|
27
39
|
|
28
40
|
This config includes
|
package/index.js
CHANGED
@@ -6,19 +6,18 @@
|
|
6
6
|
const restrictedGlobals = require('confusing-browser-globals');
|
7
7
|
|
8
8
|
module.exports = {
|
9
|
-
parser: 'babel-
|
9
|
+
parser: '@babel/eslint-parser',
|
10
10
|
|
11
11
|
env: {
|
12
12
|
browser: true,
|
13
13
|
commonjs: true,
|
14
|
-
|
14
|
+
es2021: true,
|
15
15
|
jest: true,
|
16
16
|
node: true,
|
17
17
|
mocha: true,
|
18
18
|
},
|
19
19
|
|
20
20
|
parserOptions: {
|
21
|
-
ecmaVersion: 2018,
|
22
21
|
sourceType: 'module',
|
23
22
|
ecmaFeatures: {
|
24
23
|
jsx: true,
|
@@ -29,6 +28,11 @@ module.exports = {
|
|
29
28
|
react: {
|
30
29
|
version: 'detect',
|
31
30
|
},
|
31
|
+
'import/resolver': {
|
32
|
+
node: {
|
33
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
34
|
+
},
|
35
|
+
},
|
32
36
|
},
|
33
37
|
|
34
38
|
plugins: [
|
@@ -40,7 +44,7 @@ module.exports = {
|
|
40
44
|
'chai-friendly',
|
41
45
|
],
|
42
46
|
|
43
|
-
extends: ['prettier'
|
47
|
+
extends: ['prettier'],
|
44
48
|
|
45
49
|
overrides: [
|
46
50
|
{
|
@@ -58,7 +62,8 @@ module.exports = {
|
|
58
62
|
},
|
59
63
|
plugins: ['@typescript-eslint'],
|
60
64
|
|
61
|
-
extends: ['prettier'
|
65
|
+
extends: ['prettier'],
|
66
|
+
|
62
67
|
// If adding a typescript-eslint version of an existing ESLint rule,
|
63
68
|
// make sure to disable the ESLint rule here.
|
64
69
|
rules: {
|
@@ -229,7 +234,7 @@ module.exports = {
|
|
229
234
|
{ groups: [['builtin', 'external', 'internal']] },
|
230
235
|
],
|
231
236
|
'import/no-cycle': 'error',
|
232
|
-
'import/no-unresolved': 'error',
|
237
|
+
'import/no-unresolved': ['error', { commonjs: true }],
|
233
238
|
|
234
239
|
// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
|
235
240
|
'react/forbid-foreign-prop-types': ['error', { allowInPropTypes: true }],
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint-config-adslot",
|
3
|
-
"version": "1.0
|
3
|
+
"version": "1.2.0",
|
4
4
|
"description": "ESLint configuration for Adslot",
|
5
5
|
"main": "index.js",
|
6
6
|
"files": [
|
@@ -12,7 +12,7 @@
|
|
12
12
|
},
|
13
13
|
"author": "Adslot",
|
14
14
|
"engines": {
|
15
|
-
"node": "
|
15
|
+
"node": "^16"
|
16
16
|
},
|
17
17
|
"keywords": [
|
18
18
|
"ESLint",
|
@@ -31,20 +31,20 @@
|
|
31
31
|
"release:patch": "npm version patch -m 'build: release patch version %s'"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
35
|
-
"@typescript-eslint/parser": "^
|
36
|
-
"confusing-browser-globals": "^1.0.
|
37
|
-
"eslint-config-prettier": "^
|
38
|
-
"eslint-plugin-chai-friendly": "^0.
|
39
|
-
"eslint-plugin-import": "^2.
|
40
|
-
"eslint-plugin-jsx-a11y": "^6.
|
41
|
-
"eslint-plugin-lodash": "^7.
|
42
|
-
"eslint-plugin-react": "^7.
|
43
|
-
"eslint-plugin-react-hooks": "^4.0
|
34
|
+
"@typescript-eslint/eslint-plugin": "^4.29.2",
|
35
|
+
"@typescript-eslint/parser": "^4.29.2",
|
36
|
+
"confusing-browser-globals": "^1.0.10",
|
37
|
+
"eslint-config-prettier": "^8.3.0",
|
38
|
+
"eslint-plugin-chai-friendly": "^0.7.2",
|
39
|
+
"eslint-plugin-import": "^2.25.2",
|
40
|
+
"eslint-plugin-jsx-a11y": "^6.4.1",
|
41
|
+
"eslint-plugin-lodash": "^7.3.0",
|
42
|
+
"eslint-plugin-react": "^7.24.0",
|
43
|
+
"eslint-plugin-react-hooks": "^4.2.0"
|
44
44
|
},
|
45
45
|
"peerDependencies": {
|
46
|
-
"babel-
|
47
|
-
"eslint": "
|
46
|
+
"@babel/eslint-parser": ">=7.15.0",
|
47
|
+
"eslint": ">=7.2.0"
|
48
48
|
},
|
49
49
|
"devDependencies": {}
|
50
50
|
}
|