@bigcommerce/eslint-config 2.0.0-alpha.7 → 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/README.md CHANGED
@@ -37,6 +37,19 @@ running CI with:
37
37
  eslint --max-warnings 0
38
38
  ```
39
39
 
40
+ ## Usage with Next.js
41
+
42
+ Make sure to also extend from next's `core-web-vitals`.
43
+
44
+ ```js
45
+ // .eslintrc.js
46
+ require('@bigcommerce/eslint-config/patch');
47
+
48
+ module.exports = {
49
+ extends: ['@bigcommerce/eslint-config', 'next/core-web-vitals'],
50
+ };
51
+ ```
52
+
40
53
  ## Release
41
54
 
42
55
  Please refer to the documentation of [lerna](https://github.com/lerna/lerna) for release options.
package/configs/react.js CHANGED
@@ -1,12 +1,9 @@
1
- const { hasPackage } = require('../utils');
2
-
3
1
  module.exports = {
4
2
  extends: [
5
3
  'plugin:react/recommended',
6
4
  'plugin:react-hooks/recommended',
7
5
  'plugin:jsx-a11y/recommended',
8
- hasPackage('next') && 'plugin:@next/next/recommended',
9
- ].filter(Boolean),
6
+ ],
10
7
  parserOptions: {
11
8
  ecmaFeatures: {
12
9
  jsx: true,
@@ -32,6 +29,15 @@ module.exports = {
32
29
  'react/jsx-sort-props': 'warn',
33
30
  'react/no-redundant-should-component-update': 'error',
34
31
  'react/no-this-in-sfc': 'error',
32
+ 'react/no-unescaped-entities': [
33
+ 'error',
34
+ {
35
+ forbid: [
36
+ { alternatives: ['>'], char: '>' },
37
+ { alternatives: ['}'], char: '}' },
38
+ ],
39
+ },
40
+ ],
35
41
  'react/no-unsafe': 'error',
36
42
  'react/no-unused-state': 'error',
37
43
  'react/prefer-es6-class': 'error',
@@ -109,6 +109,34 @@ module.exports = {
109
109
  ],
110
110
  '@typescript-eslint/no-use-before-define': ['error', 'nofunc'],
111
111
  '@typescript-eslint/no-useless-constructor': 'error',
112
+ '@typescript-eslint/padding-line-between-statements': [
113
+ 'warn',
114
+ {
115
+ blankLine: 'always',
116
+ next: 'return',
117
+ prev: '*',
118
+ },
119
+ {
120
+ blankLine: 'always',
121
+ next: ['block', 'block-like', 'class', 'const', 'let', 'var', 'interface'],
122
+ prev: '*',
123
+ },
124
+ {
125
+ blankLine: 'always',
126
+ next: '*',
127
+ prev: ['block', 'block-like', 'class', 'const', 'let', 'var', 'interface'],
128
+ },
129
+ {
130
+ blankLine: 'any',
131
+ next: ['const', 'let', 'var'],
132
+ prev: ['const', 'let', 'var'],
133
+ },
134
+ {
135
+ blankLine: 'any',
136
+ next: ['case'],
137
+ prev: ['case'],
138
+ },
139
+ ],
112
140
  '@typescript-eslint/prefer-for-of': 'error',
113
141
  '@typescript-eslint/prefer-function-type': 'error',
114
142
  '@typescript-eslint/require-await': 'error',
@@ -128,6 +156,7 @@ module.exports = {
128
156
  'no-unused-vars': 'off',
129
157
  'no-use-before-define': 'off',
130
158
  'no-useless-constructor': 'off',
159
+ 'padding-line-between-statements': 'off',
131
160
  'sort-keys': 'off',
132
161
  },
133
162
  settings: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigcommerce/eslint-config",
3
- "version": "2.0.0-alpha.7",
3
+ "version": "2.3.0",
4
4
  "description": "Default ESLint configuration used at BigCommerce",
5
5
  "main": "index.json",
6
6
  "files": [
@@ -20,31 +20,29 @@
20
20
  "directory": "packages/eslint-config"
21
21
  },
22
22
  "dependencies": {
23
- "@bigcommerce/eslint-plugin": "^1.0.0-alpha.0",
24
- "@next/eslint-plugin-next": "^11.0.1",
25
- "@rushstack/eslint-patch": "^1.0.6",
26
- "@typescript-eslint/eslint-plugin": "^4.22.0",
27
- "@typescript-eslint/parser": "^4.22.0",
23
+ "@bigcommerce/eslint-plugin": "^1.1.0",
24
+ "@rushstack/eslint-patch": "^1.1.0",
25
+ "@typescript-eslint/eslint-plugin": "^5.3.1",
26
+ "@typescript-eslint/parser": "^5.3.1",
28
27
  "eslint-config-prettier": "^8.3.0",
29
- "eslint-import-resolver-typescript": "^2.4.0",
30
- "eslint-plugin-gettext": "^1.1.0",
31
- "eslint-plugin-import": "^2.22.1",
32
- "eslint-plugin-jest": "^24.3.6",
28
+ "eslint-import-resolver-typescript": "^2.5.0",
29
+ "eslint-plugin-gettext": "^1.2.0",
30
+ "eslint-plugin-import": "^2.25.3",
31
+ "eslint-plugin-jest": "^25.2.4",
33
32
  "eslint-plugin-jest-formatting": "^3.0.0",
34
- "eslint-plugin-jsdoc": "^35.1.2",
35
- "eslint-plugin-jsx-a11y": "^6.4.1",
36
- "eslint-plugin-prettier": "^3.4.0",
37
- "eslint-plugin-react": "^7.23.2",
38
- "eslint-plugin-react-hooks": "^4.2.0",
33
+ "eslint-plugin-jsdoc": "^37.0.3",
34
+ "eslint-plugin-jsx-a11y": "^6.5.1",
35
+ "eslint-plugin-prettier": "^4.0.0",
36
+ "eslint-plugin-react": "^7.27.0",
37
+ "eslint-plugin-react-hooks": "^4.3.0",
39
38
  "eslint-plugin-switch-case": "^1.1.2",
40
- "prettier": "^2.2.1"
39
+ "prettier": "^2.4.1"
41
40
  },
42
41
  "devDependencies": {
43
- "next": "^11.0.1",
44
42
  "react": "^17.0.2"
45
43
  },
46
44
  "peerDependencies": {
47
- "eslint": "^7.0.0",
45
+ "eslint": "^8.0.0",
48
46
  "typescript": "^4.0.0"
49
47
  },
50
48
  "peerDependenciesMeta": {
@@ -52,5 +50,5 @@
52
50
  "optional": true
53
51
  }
54
52
  },
55
- "gitHead": "c348dc6e025a0c196d31d49e8bcaf26ccbd42b1d"
53
+ "gitHead": "ad7b31b7b50716477f2fea9117ef1cf5cc82f65d"
56
54
  }