@fullstacksjs/eslint-config 8.7.3 → 8.8.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/index.js CHANGED
@@ -1,21 +1,14 @@
1
- const fs = require('fs');
2
- const { Packages } = require('@frontendmonster/utils');
3
- const readPkgUp = require('read-pkg-up');
4
-
5
- const { packageJson: pkg } = readPkgUp.sync({
6
- cwd: fs.realpathSync(process.cwd()),
7
- });
8
-
9
- const packages = Packages(pkg);
1
+ const packages = require('./packages');
2
+ const { compact } = require('@fullstacksjs/toolbox');
10
3
 
11
4
  /** @type { import('eslint').Linter.Config } */
12
5
  module.exports = {
13
- extends: [
6
+ extends: compact([
14
7
  require.resolve('./base'),
15
8
  require.resolve('./storybook'),
16
9
  require.resolve('./jest'),
17
10
  packages.ifAnyDep('react', () => require.resolve('./react')),
18
11
  packages.ifAnyDep('typescript', () => require.resolve('./typescript')),
19
12
  packages.ifAnyDep('cypress', () => require.resolve('./cypress')),
20
- ].filter(Boolean),
13
+ ]),
21
14
  };
package/jest.js CHANGED
@@ -10,7 +10,7 @@ module.exports = {
10
10
  env: {
11
11
  'jest/globals': true,
12
12
  },
13
- extends: ['./rules/jest'],
13
+ extends: ['./rules/jest', './rules/jest-format'],
14
14
  },
15
15
  ],
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "8.7.3",
3
+ "version": "8.8.2",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -23,6 +23,7 @@
23
23
  "nextjs.js",
24
24
  "cypress.js",
25
25
  "storybook.js",
26
+ "packages.js",
26
27
  "graphql.js",
27
28
  "react.js",
28
29
  "typescript.js",
@@ -46,30 +47,33 @@
46
47
  },
47
48
  "main": "index.js",
48
49
  "dependencies": {
49
- "@frontendmonster/utils": "0.3.11",
50
- "@graphql-eslint/eslint-plugin": "3.10.7",
51
- "@typescript-eslint/eslint-plugin": "5.36.1",
52
- "@typescript-eslint/parser": "5.36.1",
50
+ "@fullstacksjs/toolbox": "2.21.0",
51
+ "@graphql-eslint/eslint-plugin": "3.11.2",
52
+ "@typescript-eslint/eslint-plugin": "5.39.0",
53
+ "@typescript-eslint/parser": "5.39.0",
53
54
  "eslint-config-prettier": "8.5.0",
54
- "eslint-import-resolver-typescript": "3.5.0",
55
+ "eslint-import-resolver-typescript": "3.5.1",
55
56
  "eslint-plugin-cypress": "2.12.1",
56
57
  "eslint-plugin-fp": "2.3.0",
57
58
  "eslint-plugin-import": "2.26.0",
58
- "eslint-plugin-jest": "27.0.1",
59
+ "eslint-plugin-jest": "27.1.1",
59
60
  "eslint-plugin-jest-formatting": "3.1.0",
60
61
  "eslint-plugin-jsx-a11y": "6.6.1",
61
62
  "eslint-plugin-node": "11.1.0",
62
63
  "eslint-plugin-prettier": "4.2.1",
63
64
  "eslint-plugin-promise": "6.0.1",
64
- "eslint-plugin-react": "7.31.4",
65
+ "eslint-plugin-react": "7.31.8",
65
66
  "eslint-plugin-react-hooks": "4.6.0",
66
67
  "eslint-plugin-simple-import-sort": "8.0.0",
67
68
  "eslint-plugin-storybook": "0.6.4",
68
69
  "read-pkg-up": "7.0.1"
69
70
  },
70
71
  "devDependencies": {
71
- "cspell": "6.8.1",
72
- "eslint": "8.23.0",
72
+ "@semantic-release/github": "8.0.6",
73
+ "@semantic-release/npm": "9.0.1",
74
+ "@semantic-release/release-notes-generator": "10.0.3",
75
+ "cspell": "6.12.0",
76
+ "eslint": "8.24.0",
73
77
  "eslint-find-rules": "4.1.0",
74
78
  "husky": "8.0.1",
75
79
  "lint-staged": "13.0.3",
@@ -77,7 +81,8 @@
77
81
  "npm-run-all": "4.1.5",
78
82
  "pinst": "3.0.0",
79
83
  "prettier": "2.7.1",
80
- "typescript": "4.8.2"
84
+ "semantic-release": "19.0.5",
85
+ "typescript": "4.8.4"
81
86
  },
82
87
  "peerDependencies": {
83
88
  "cypress": ">=8",
package/packages.js ADDED
@@ -0,0 +1,9 @@
1
+ const { Packages } = require('@fullstacksjs/toolbox');
2
+ const readPkgUp = require('read-pkg-up');
3
+ const fs = require('node:fs');
4
+
5
+ const { packageJson: pkg } = readPkgUp.sync({
6
+ cwd: fs.realpathSync(process.cwd()),
7
+ });
8
+
9
+ module.exports = Packages(pkg);
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ rules: {
3
+ 'jest-formatting/padding-around-after-all-blocks': 'warn',
4
+ 'jest-formatting/padding-around-after-each-blocks': 'warn',
5
+ 'jest-formatting/padding-around-all': 'warn',
6
+ 'jest-formatting/padding-around-before-all-blocks': 'warn',
7
+ 'jest-formatting/padding-around-before-each-blocks': 'warn',
8
+ 'jest-formatting/padding-around-describe-blocks': 'warn',
9
+ 'jest-formatting/padding-around-expect-groups': 'warn',
10
+ 'jest-formatting/padding-around-test-blocks': 'warn',
11
+ },
12
+ };
package/rules/jest.js CHANGED
@@ -1,3 +1,5 @@
1
+ const packages = require('../packages');
2
+
1
3
  module.exports = {
2
4
  rules: {
3
5
  'jest/consistent-test-it': 'off',
@@ -8,7 +10,6 @@ module.exports = {
8
10
  'jest/no-commented-out-tests': 'warn',
9
11
  'jest/no-conditional-expect': 'error',
10
12
  'jest/no-conditional-in-test': 'error',
11
- 'jest/no-deprecated-functions': 'error',
12
13
  'jest/no-disabled-tests': 'warn',
13
14
  'jest/no-done-callback': 'warn',
14
15
  'jest/no-duplicate-hooks': 'off',
@@ -21,6 +22,7 @@ module.exports = {
21
22
  'jest/no-jasmine-globals': 'off',
22
23
  'jest/no-large-snapshots': ['warn', { maxSize: 300 }],
23
24
  'jest/no-mocks-import': 'error',
25
+ 'jest/no-restricted-jest-methods': 'off',
24
26
  'jest/no-restricted-matchers': 'error',
25
27
  'jest/no-standalone-expect': 'off',
26
28
  'jest/no-test-callback': 'off',
@@ -44,27 +46,25 @@ module.exports = {
44
46
  'jest/prefer-to-contain': 'warn',
45
47
  'jest/prefer-to-have-length': 'warn',
46
48
  'jest/prefer-todo': 'warn',
47
- 'jest/require-hook': 'error',
49
+ 'jest/require-hook': 'off',
48
50
  'jest/require-to-throw-message': 'off',
49
51
  'jest/require-top-level-describe': 'off',
50
- 'jest/unbound-method': 'error',
51
52
  'jest/valid-describe-callback': 'error',
52
53
  'jest/valid-expect-in-promise': 'error',
53
54
  'jest/valid-expect': 'error',
54
55
  'jest/valid-title': 'warn',
55
56
 
56
- // jest-formatting
57
- 'jest-formatting/padding-around-after-all-blocks': 'warn',
58
- 'jest-formatting/padding-around-after-each-blocks': 'warn',
59
- 'jest-formatting/padding-around-all': 'warn',
60
- 'jest-formatting/padding-around-before-all-blocks': 'warn',
61
- 'jest-formatting/padding-around-before-each-blocks': 'warn',
62
- 'jest-formatting/padding-around-describe-blocks': 'warn',
63
- 'jest-formatting/padding-around-expect-groups': 'warn',
64
- 'jest-formatting/padding-around-test-blocks': 'warn',
57
+ 'jest/no-deprecated-functions': 'off',
58
+ ...packages.ifAnyDep('jest', () => ({
59
+ 'jest/no-deprecated-functions': 'error',
60
+ })),
61
+
62
+ ...packages.ifAnyDep('typescript', () => ({
63
+ '@typescript-eslint/unbound-method': 'off',
64
+ 'jest/unbound-method': 'error',
65
+ })),
65
66
 
66
67
  // conflicts
67
- '@typescript-eslint/unbound-method': 'off',
68
68
  'fp/no-let': 'off',
69
69
  },
70
70
  };
package/rules/react.js CHANGED
@@ -11,7 +11,7 @@ module.exports = {
11
11
  'react/forbid-foreign-prop-types': 'error',
12
12
  'react/forbid-prop-types': 'off',
13
13
  'react/function-component-definition': ['warn', { namedComponents: 'arrow-function', unnamedComponents: 'arrow-function' }],
14
- 'react/hook-use-state': 'warn',
14
+ 'react/hook-use-state': 'off',
15
15
  'react/iframe-missing-sandbox': 'error',
16
16
  'react/jsx-boolean-value': 'warn',
17
17
  'react/jsx-child-element-spacing': 'warn',
package/rules/style.js CHANGED
@@ -17,14 +17,15 @@ module.exports = {
17
17
  // __filename, camelCase, PascalCase, CONST_VALUE, stream$, $el
18
18
  '^\\$?(__)?(([A-Z]|[a-z]|[0-9]+)|([A-Z_]))*\\$?$',
19
19
  ],
20
- 'linebreak-style': ['error', 'unix'],
21
20
  'line-comment-position': 'off',
21
+ 'linebreak-style': ['error', 'unix'],
22
22
  'lines-around-comment': 'off',
23
23
  'lines-between-class-members': ['warn', 'always', { exceptAfterSingleLine: false }],
24
+ 'logical-assignment-operators': 'off',
24
25
  'max-classes-per-file': 'off',
25
26
  'max-depth': ['error', 4],
26
- 'max-lines': ['error', { max: 2500, skipBlankLines: false, skipComments: false }],
27
27
  'max-lines-per-function': ['error', 150],
28
+ 'max-lines': ['error', { max: 2500, skipBlankLines: false, skipComments: false }],
28
29
  'max-nested-callbacks': ['error', 7],
29
30
  'max-params': ['error', 7],
30
31
  'max-statements-per-line': ['error', { max: 1 }],