@bigcommerce/eslint-config 2.9.0 → 2.10.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/configs/base.js +1 -0
- package/configs/jest-dom.js +5 -0
- package/configs/jest.js +1 -0
- package/configs/jsdoc.js +1 -0
- package/configs/prettier.js +6 -14
- package/configs/react.js +1 -0
- package/configs/testing-library.js +8 -0
- package/configs/typescript.js +1 -0
- package/index.js +8 -0
- package/package.json +13 -9
package/configs/base.js
CHANGED
package/configs/jest.js
CHANGED
package/configs/jsdoc.js
CHANGED
package/configs/prettier.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
const { resolveConfigFile } = require('prettier');
|
|
1
|
+
const path = require('path');
|
|
3
2
|
|
|
4
3
|
const defaultConfig = require('../prettier.config');
|
|
5
4
|
|
|
6
5
|
function getRules() {
|
|
7
|
-
const
|
|
8
|
-
|
|
6
|
+
const pkgPath = path.resolve(process.cwd(), 'package.json');
|
|
7
|
+
// eslint-disable-next-line import/no-dynamic-require
|
|
8
|
+
const pkg = require(pkgPath);
|
|
9
9
|
|
|
10
|
-
if (
|
|
10
|
+
if (pkg.prettier !== '@bigcommerce/eslint-config/prettier') {
|
|
11
11
|
throw new Error(`
|
|
12
12
|
=================================================================================
|
|
13
13
|
Please add "prettier": "@bigcommerce/eslint-config/prettier" to your package.json
|
|
@@ -15,21 +15,13 @@ function getRules() {
|
|
|
15
15
|
`);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
if (basename(prettierConfigFile) !== 'package.json') {
|
|
19
|
-
throw new Error(`
|
|
20
|
-
=================================================================================
|
|
21
|
-
Please add "prettier": "@bigcommerce/eslint-config/prettier" to your package.json
|
|
22
|
-
and remove any other prettier config file
|
|
23
|
-
=================================================================================
|
|
24
|
-
`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
18
|
return {
|
|
28
19
|
curly: ['error', 'all'],
|
|
29
20
|
'prettier/prettier': ['warn', defaultConfig, { usePrettierrc: false }],
|
|
30
21
|
};
|
|
31
22
|
}
|
|
32
23
|
|
|
24
|
+
/** @type {import("eslint").Linter.Config} */
|
|
33
25
|
module.exports = {
|
|
34
26
|
extends: ['plugin:prettier/recommended'],
|
|
35
27
|
rules: getRules(),
|
package/configs/react.js
CHANGED
package/configs/typescript.js
CHANGED
package/index.js
CHANGED
|
@@ -7,6 +7,14 @@ module.exports = {
|
|
|
7
7
|
extends: './configs/jest',
|
|
8
8
|
files: ['**/*.spec.*', '**/spec.*', 'jest-setup.*'],
|
|
9
9
|
},
|
|
10
|
+
hasPackage('@testing-library/jest-dom') && {
|
|
11
|
+
extends: './configs/jest-dom',
|
|
12
|
+
files: ['**/*.spec.*', '**/spec.*', 'jest-setup.*'],
|
|
13
|
+
},
|
|
14
|
+
hasPackage('@testing-library/react') && {
|
|
15
|
+
extends: './configs/testing-library',
|
|
16
|
+
files: ['**/*.spec.*', '**/spec.*', 'jest-setup.*'],
|
|
17
|
+
},
|
|
10
18
|
hasPackage('react') && {
|
|
11
19
|
extends: './configs/react',
|
|
12
20
|
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigcommerce/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Default ESLint configuration used at BigCommerce",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -20,26 +20,30 @@
|
|
|
20
20
|
"directory": "packages/eslint-config"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@bigcommerce/eslint-plugin": "^1.3.
|
|
23
|
+
"@bigcommerce/eslint-plugin": "^1.3.1",
|
|
24
24
|
"@rushstack/eslint-patch": "^1.1.3",
|
|
25
25
|
"@stylistic/eslint-plugin": "^2.1.0",
|
|
26
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
27
|
-
"@typescript-eslint/parser": "^
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^8.4.0",
|
|
27
|
+
"@typescript-eslint/parser": "^8.4.0",
|
|
28
28
|
"eslint-config-prettier": "^9.1.0",
|
|
29
29
|
"eslint-import-resolver-typescript": "^3.5.2",
|
|
30
30
|
"eslint-plugin-gettext": "^1.2.0",
|
|
31
31
|
"eslint-plugin-import": "^2.26.0",
|
|
32
32
|
"eslint-plugin-jest": "^28.4.0",
|
|
33
|
+
"eslint-plugin-jest-dom": "^5.5.0",
|
|
33
34
|
"eslint-plugin-jest-formatting": "^3.1.0",
|
|
34
|
-
"eslint-plugin-jsdoc": "^
|
|
35
|
+
"eslint-plugin-jsdoc": "^50.2.2",
|
|
35
36
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
36
|
-
"eslint-plugin-prettier": "^
|
|
37
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
37
38
|
"eslint-plugin-react": "^7.29.4",
|
|
38
|
-
"eslint-plugin-react-hooks": "^
|
|
39
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
39
40
|
"eslint-plugin-switch-case": "^1.1.2",
|
|
40
|
-
"
|
|
41
|
+
"eslint-plugin-testing-library": "^7.0.0",
|
|
42
|
+
"prettier": "^3.3.3"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
45
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
46
|
+
"@testing-library/react": "^16.0.1",
|
|
43
47
|
"react": "^18.3.1"
|
|
44
48
|
},
|
|
45
49
|
"peerDependencies": {
|
|
@@ -51,5 +55,5 @@
|
|
|
51
55
|
"optional": true
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "6ab2382726d4770d615d5a55a9d4220e1c69af28"
|
|
55
59
|
}
|