@cabify/eslint-config 2.1.4-beta.1 → 3.0.1-beta
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 +0 -11
- package/configs/base.js +54 -30
- package/configs/es6.js +13 -11
- package/configs/formats.js +5 -0
- package/configs/imports.js +13 -6
- package/configs/jest.js +11 -3
- package/configs/lodash.js +3 -1
- package/configs/node.js +0 -4
- package/configs/react-a11y.js +11 -7
- package/configs/react.js +12 -5
- package/eslint.config.js +3 -0
- package/package.json +11 -12
- package/recommended.js +4 -3
- package/utils.js +1 -0
- package/.eslintrc.js +0 -3
- package/configs/format.js +0 -4
- package/legacy.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,17 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
- Fixing dependencies not published properly in `v2.1.3`.
|
|
11
|
-
- Revert eslint-plugin-lodash version bump because it requires ESLint v9.
|
|
12
|
-
|
|
13
|
-
## [2.1.3] - 2024-09-12
|
|
14
|
-
|
|
15
|
-
- Updating eslint-plugin dependencies.
|
|
16
|
-
|
|
17
|
-
## [2.1.2] - 2024-09-12
|
|
18
|
-
|
|
19
|
-
- Updating typescript-eslint dependencies.
|
|
20
|
-
|
|
21
10
|
## [2.1.1] - 2024-07-10
|
|
22
11
|
|
|
23
12
|
- Updating naming convention for imports. Added `camelCase`, `PascalCase` and `UPPER_CASE`.
|
package/configs/base.js
CHANGED
|
@@ -1,52 +1,76 @@
|
|
|
1
|
+
const globals = require('globals');
|
|
2
|
+
|
|
1
3
|
const { isPackageAvailable } = require('../utils');
|
|
2
4
|
|
|
3
5
|
const isTSAvailable = isPackageAvailable('typescript');
|
|
4
6
|
const isJestAvailable = isPackageAvailable('jest');
|
|
5
7
|
|
|
8
|
+
const storybook = require('./storybook');
|
|
9
|
+
const ts = require('./ts');
|
|
10
|
+
const postcss = require('./postcss');
|
|
11
|
+
|
|
12
|
+
const bestPractices = require('./best-practices');
|
|
13
|
+
const errors = require('./errors');
|
|
14
|
+
const es6 = require('./es6');
|
|
15
|
+
const imports = require('./imports');
|
|
16
|
+
const node = require('./node');
|
|
17
|
+
const promises = require('./promises');
|
|
18
|
+
const strict = require('./strict');
|
|
19
|
+
const style = require('./style');
|
|
20
|
+
const variables = require('./variables');
|
|
21
|
+
const react = require('./react');
|
|
22
|
+
const lodash = require('./lodash');
|
|
23
|
+
const reactA11y = require('./react-a11y');
|
|
24
|
+
const jest = require('./jest');
|
|
25
|
+
const formats = require('./formats');
|
|
26
|
+
|
|
6
27
|
const configs = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
bestPractices,
|
|
29
|
+
errors,
|
|
30
|
+
es6,
|
|
31
|
+
imports,
|
|
32
|
+
node,
|
|
33
|
+
promises,
|
|
34
|
+
strict,
|
|
35
|
+
style,
|
|
36
|
+
variables,
|
|
37
|
+
react,
|
|
38
|
+
lodash,
|
|
39
|
+
reactA11y,
|
|
40
|
+
formats,
|
|
41
|
+
isJestAvailable && jest,
|
|
20
42
|
].filter(Boolean);
|
|
21
43
|
|
|
22
44
|
const overrides = [
|
|
23
45
|
isTSAvailable && {
|
|
24
46
|
files: ['**/*.ts', '**/*.tsx'],
|
|
25
47
|
excludedFiles: '*.d.ts',
|
|
26
|
-
|
|
48
|
+
...ts,
|
|
27
49
|
},
|
|
28
50
|
{
|
|
29
51
|
files: ['*.story.tsx', '*.stories.tsx'],
|
|
30
|
-
|
|
52
|
+
...storybook,
|
|
31
53
|
},
|
|
32
54
|
{
|
|
33
55
|
files: ['postcss.config.js'],
|
|
34
|
-
|
|
56
|
+
...postcss,
|
|
35
57
|
},
|
|
36
58
|
].filter(Boolean);
|
|
37
59
|
|
|
38
|
-
module.exports =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
module.exports = [
|
|
61
|
+
...configs,
|
|
62
|
+
{
|
|
63
|
+
languageOptions: {
|
|
64
|
+
ecmaVersion: 2022,
|
|
65
|
+
sourceType: 'module',
|
|
66
|
+
globals: {
|
|
67
|
+
...globals.browser,
|
|
68
|
+
...globals.node,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
rules: {
|
|
72
|
+
strict: 'error',
|
|
73
|
+
},
|
|
50
74
|
},
|
|
51
|
-
overrides,
|
|
52
|
-
|
|
75
|
+
...overrides,
|
|
76
|
+
];
|
package/configs/es6.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
2
|
+
// languageOptions: {
|
|
3
|
+
// globals: {
|
|
4
|
+
// es6: true,
|
|
5
|
+
// },
|
|
6
|
+
// ecmaVersion: 6,
|
|
7
|
+
// sourceType: 'module',
|
|
8
|
+
// parserOptions: {
|
|
9
|
+
// ecmaFeatures: {
|
|
10
|
+
// generators: false,
|
|
11
|
+
// objectLiteralDuplicateProperties: false,
|
|
12
|
+
// },
|
|
13
|
+
// },
|
|
14
|
+
// },
|
|
13
15
|
|
|
14
16
|
rules: {
|
|
15
17
|
// verify super() callings in constructors
|
package/configs/imports.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
const importPlugin = require('eslint-plugin-import');
|
|
2
|
+
const simpleImportSort = require('eslint-plugin-simple-import-sort');
|
|
3
|
+
|
|
1
4
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
5
|
+
// languageOptions: {
|
|
6
|
+
// globals: {
|
|
7
|
+
// es6: true,
|
|
8
|
+
// },
|
|
9
|
+
// },
|
|
10
|
+
plugins: {
|
|
11
|
+
import: importPlugin,
|
|
12
|
+
'simple-import-sort': simpleImportSort,
|
|
4
13
|
},
|
|
5
|
-
plugins: ['import', 'simple-import-sort'],
|
|
6
|
-
|
|
7
14
|
settings: {
|
|
8
15
|
'import/resolver': {
|
|
9
16
|
node: {
|
|
@@ -107,7 +114,7 @@ module.exports = {
|
|
|
107
114
|
|
|
108
115
|
// disallow AMD require/define
|
|
109
116
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
110
|
-
'import/no-amd': 'error',
|
|
117
|
+
// 'import/no-amd': 'error',
|
|
111
118
|
|
|
112
119
|
// No Node.js builtin modules
|
|
113
120
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
|
|
@@ -155,7 +162,7 @@ module.exports = {
|
|
|
155
162
|
|
|
156
163
|
// Require a newline after the last import/require in a group
|
|
157
164
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
158
|
-
'import/newline-after-import': 'error',
|
|
165
|
+
// 'import/newline-after-import': 'error',
|
|
159
166
|
|
|
160
167
|
// Require modules with a single export to use a default export
|
|
161
168
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
package/configs/jest.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
const jest = require('eslint-plugin-jest');
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
// languageOptions: {
|
|
5
|
+
// globals: {
|
|
6
|
+
// 'jest/globals': true,
|
|
7
|
+
// },
|
|
8
|
+
// },
|
|
9
|
+
rules: {
|
|
10
|
+
...jest.configs['flat/recommended'],
|
|
11
|
+
...jest.configs['flat/styles'],
|
|
12
|
+
},
|
|
5
13
|
};
|
package/configs/lodash.js
CHANGED
package/configs/node.js
CHANGED
package/configs/react-a11y.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
plugins: ['jsx-a11y', 'react'],
|
|
1
|
+
const jsxAllyPlugin = require('eslint-plugin-jsx-a11y');
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
module.exports = {
|
|
4
|
+
plugins: { 'jsx-a11y': jsxAllyPlugin },
|
|
5
|
+
|
|
6
|
+
// languageOptions: {
|
|
7
|
+
// parserOptions: {
|
|
8
|
+
// ecmaFeatures: {
|
|
9
|
+
// jsx: true,
|
|
10
|
+
// },
|
|
11
|
+
// },
|
|
12
|
+
// },
|
|
9
13
|
|
|
10
14
|
rules: {
|
|
11
15
|
// Enforce that anchors have content
|
package/configs/react.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const react = require('eslint-plugin-react');
|
|
2
|
+
const reactHooks = require('eslint-plugin-react-hooks');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
module.exports = {
|
|
5
|
+
plugins: {
|
|
6
|
+
react,
|
|
7
|
+
'react-hooks': reactHooks,
|
|
8
|
+
},
|
|
9
|
+
languageOptions: {
|
|
10
|
+
parserOptions: {
|
|
11
|
+
ecmaFeatures: {
|
|
12
|
+
jsx: true,
|
|
13
|
+
},
|
|
7
14
|
},
|
|
8
15
|
},
|
|
9
16
|
|
package/eslint.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabify/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1-beta",
|
|
4
4
|
"description": "ESLint config for Cabify Javascript projects",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "echo 'No build to perform'",
|
|
@@ -33,11 +33,9 @@
|
|
|
33
33
|
"style",
|
|
34
34
|
"standards"
|
|
35
35
|
],
|
|
36
|
-
"main": "
|
|
36
|
+
"main": "../recommended.js",
|
|
37
37
|
"exports": {
|
|
38
|
-
".": "./
|
|
39
|
-
"./legacy": "./legacy.js",
|
|
40
|
-
"./recommended": "./recommended.js"
|
|
38
|
+
".": "./recommended.js"
|
|
41
39
|
},
|
|
42
40
|
"dependencies": {
|
|
43
41
|
"@typescript-eslint/eslint-plugin": "^8.4.0",
|
|
@@ -45,20 +43,21 @@
|
|
|
45
43
|
"confusing-browser-globals": "^1.0.10",
|
|
46
44
|
"eslint-config-prettier": "^9.1.0",
|
|
47
45
|
"eslint-plugin-import": "^2.30.0",
|
|
48
|
-
"eslint-plugin-jest": "^28.
|
|
49
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
50
|
-
"eslint-plugin-lodash": "^7.
|
|
46
|
+
"eslint-plugin-jest": "^28.2.0",
|
|
47
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
48
|
+
"eslint-plugin-lodash": "^7.3.0",
|
|
51
49
|
"eslint-plugin-prettier": "^5.2.1",
|
|
52
|
-
"eslint-plugin-react": "^7.
|
|
53
|
-
"eslint-plugin-react-hooks": "^4.
|
|
54
|
-
"eslint-plugin-simple-import-sort": "^12.1.
|
|
50
|
+
"eslint-plugin-react": "^7.35.2",
|
|
51
|
+
"eslint-plugin-react-hooks": "^4.3.0",
|
|
52
|
+
"eslint-plugin-simple-import-sort": "^12.1.0",
|
|
53
|
+
"globals": "^13.6.0"
|
|
55
54
|
},
|
|
56
55
|
"peerDependencies": {
|
|
57
56
|
"eslint": ">= 8.0.1",
|
|
58
57
|
"prettier": ">= 2.2.1"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
|
-
"eslint": "
|
|
60
|
+
"eslint": "9.1.0",
|
|
62
61
|
"prettier": "3.3.3"
|
|
63
62
|
},
|
|
64
63
|
"publishConfig": {
|
package/recommended.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const base = require('./configs/base');
|
|
2
|
+
const eslintConfigPrettier = require('eslint-config-prettier');
|
|
3
|
+
|
|
4
|
+
module.exports = [...base, eslintConfigPrettier];
|
package/utils.js
CHANGED
package/.eslintrc.js
DELETED
package/configs/format.js
DELETED
package/legacy.js
DELETED