@cabify/eslint-config 2.1.4 → 3.0.1-beta-2
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 +2 -0
- package/configs/base.js +55 -30
- package/configs/best-practices.js +1 -0
- package/configs/errors.js +1 -0
- package/configs/es6.js +14 -11
- package/configs/formats.js +6 -0
- package/configs/imports.js +14 -6
- package/configs/jest.js +12 -3
- package/configs/lodash.js +4 -2
- package/configs/node.js +1 -4
- package/configs/postcss.js +1 -0
- package/configs/promises.js +1 -0
- package/configs/react-a11y.js +12 -7
- package/configs/react.js +13 -5
- package/configs/storybook.js +1 -0
- package/configs/strict.js +1 -0
- package/configs/style.js +1 -0
- package/configs/ts.js +1 -0
- package/configs/variables.js +1 -0
- package/eslint.config.js +3 -0
- package/package.json +7 -8
- 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,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.1.4] - 2024-09-12
|
|
11
|
+
|
|
10
12
|
- Fixing dependencies not published properly in `v2.1.3`.
|
|
11
13
|
- Revert eslint-plugin-lodash version bump because it requires ESLint v9.
|
|
12
14
|
|
package/configs/base.js
CHANGED
|
@@ -1,52 +1,77 @@
|
|
|
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
|
+
name: 'base-cabify-eslint-config',
|
|
64
|
+
languageOptions: {
|
|
65
|
+
ecmaVersion: 2022,
|
|
66
|
+
sourceType: 'module',
|
|
67
|
+
globals: {
|
|
68
|
+
...globals.browser,
|
|
69
|
+
...globals.node,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
rules: {
|
|
73
|
+
strict: 'error',
|
|
74
|
+
},
|
|
50
75
|
},
|
|
51
|
-
overrides,
|
|
52
|
-
|
|
76
|
+
...overrides,
|
|
77
|
+
];
|
package/configs/errors.js
CHANGED
package/configs/es6.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
name: 'ES6-cabify-eslint-config',
|
|
3
|
+
// languageOptions: {
|
|
4
|
+
// globals: {
|
|
5
|
+
// es6: true,
|
|
6
|
+
// },
|
|
7
|
+
// ecmaVersion: 6,
|
|
8
|
+
// sourceType: 'module',
|
|
9
|
+
// parserOptions: {
|
|
10
|
+
// ecmaFeatures: {
|
|
11
|
+
// generators: false,
|
|
12
|
+
// objectLiteralDuplicateProperties: false,
|
|
13
|
+
// },
|
|
14
|
+
// },
|
|
15
|
+
// },
|
|
13
16
|
|
|
14
17
|
rules: {
|
|
15
18
|
// verify super() callings in constructors
|
package/configs/imports.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
const importPlugin = require('eslint-plugin-import');
|
|
2
|
+
const simpleImportSort = require('eslint-plugin-simple-import-sort');
|
|
3
|
+
|
|
1
4
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
5
|
+
name: 'imports-cabify-eslint-config',
|
|
6
|
+
// languageOptions: {
|
|
7
|
+
// globals: {
|
|
8
|
+
// es6: true,
|
|
9
|
+
// },
|
|
10
|
+
// },
|
|
11
|
+
plugins: {
|
|
12
|
+
import: importPlugin,
|
|
13
|
+
'simple-import-sort': simpleImportSort,
|
|
4
14
|
},
|
|
5
|
-
plugins: ['import', 'simple-import-sort'],
|
|
6
|
-
|
|
7
15
|
settings: {
|
|
8
16
|
'import/resolver': {
|
|
9
17
|
node: {
|
|
@@ -107,7 +115,7 @@ module.exports = {
|
|
|
107
115
|
|
|
108
116
|
// disallow AMD require/define
|
|
109
117
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
110
|
-
'import/no-amd': 'error',
|
|
118
|
+
// 'import/no-amd': 'error',
|
|
111
119
|
|
|
112
120
|
// No Node.js builtin modules
|
|
113
121
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
|
|
@@ -155,7 +163,7 @@ module.exports = {
|
|
|
155
163
|
|
|
156
164
|
// Require a newline after the last import/require in a group
|
|
157
165
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
158
|
-
'import/newline-after-import': 'error',
|
|
166
|
+
// 'import/newline-after-import': 'error',
|
|
159
167
|
|
|
160
168
|
// Require modules with a single export to use a default export
|
|
161
169
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
package/configs/jest.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
const jest = require('eslint-plugin-jest');
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
name: 'jest-cabify-eslint-config',
|
|
5
|
+
// languageOptions: {
|
|
6
|
+
// globals: {
|
|
7
|
+
// 'jest/globals': true,
|
|
8
|
+
// },
|
|
9
|
+
// },
|
|
10
|
+
rules: {
|
|
11
|
+
...jest.configs['flat/recommended'],
|
|
12
|
+
...jest.configs['flat/styles'],
|
|
13
|
+
},
|
|
5
14
|
};
|
package/configs/lodash.js
CHANGED
package/configs/node.js
CHANGED
package/configs/postcss.js
CHANGED
package/configs/promises.js
CHANGED
package/configs/react-a11y.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
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
|
+
name: 'react-a11y-cabify-eslint-config',
|
|
5
|
+
plugins: { 'jsx-a11y': jsxAllyPlugin },
|
|
6
|
+
|
|
7
|
+
// languageOptions: {
|
|
8
|
+
// parserOptions: {
|
|
9
|
+
// ecmaFeatures: {
|
|
10
|
+
// jsx: true,
|
|
11
|
+
// },
|
|
12
|
+
// },
|
|
13
|
+
// },
|
|
9
14
|
|
|
10
15
|
rules: {
|
|
11
16
|
// Enforce that anchors have content
|
package/configs/react.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
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
|
+
name: 'react-cabify-eslint-config',
|
|
6
|
+
plugins: {
|
|
7
|
+
react,
|
|
8
|
+
'react-hooks': reactHooks,
|
|
9
|
+
},
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaFeatures: {
|
|
13
|
+
jsx: true,
|
|
14
|
+
},
|
|
7
15
|
},
|
|
8
16
|
},
|
|
9
17
|
|
package/configs/storybook.js
CHANGED
package/configs/strict.js
CHANGED
package/configs/style.js
CHANGED
package/configs/ts.js
CHANGED
package/configs/variables.js
CHANGED
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-2",
|
|
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",
|
|
@@ -51,14 +49,15 @@
|
|
|
51
49
|
"eslint-plugin-prettier": "^5.2.1",
|
|
52
50
|
"eslint-plugin-react": "^7.36.0",
|
|
53
51
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
54
|
-
"eslint-plugin-simple-import-sort": "^12.1.1"
|
|
52
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
53
|
+
"globals": "^15.9.0"
|
|
55
54
|
},
|
|
56
55
|
"peerDependencies": {
|
|
57
|
-
"eslint": "
|
|
56
|
+
"eslint": "9.1.0",
|
|
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