@shelf/eslint-config 2.19.3 → 2.20.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/common/plugins.js CHANGED
@@ -5,4 +5,5 @@ module.exports = [
5
5
  'json-format',
6
6
  'prettier',
7
7
  'import',
8
+ 'node',
8
9
  ];
@@ -7,6 +7,7 @@ const consistentTypeImports = require('./rules/consistent-type-imports.json');
7
7
  const frontendConfig = require('./frontend');
8
8
  const youDontNeedLodashRules = require('./rules/you-dont-need-lodash.json');
9
9
  const typescriptRules = require('./rules/typescript');
10
+ const restrictedPackagesImportRules = require('./rules/restricted-packages-import.json');
10
11
 
11
12
  module.exports = {
12
13
  extends: ['./frontend.js', ...commonExtends, 'plugin:you-dont-need-lodash-underscore/compatible'],
@@ -38,6 +39,7 @@ module.exports = {
38
39
  // Don`t need for typescript files
39
40
  '@typescript-eslint/no-empty-function': 'off',
40
41
  ...typescriptRules,
42
+ ...restrictedPackagesImportRules,
41
43
  },
42
44
  overrides: [
43
45
  allowRequireInConfigs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shelf/eslint-config",
3
- "version": "2.19.3",
3
+ "version": "2.20.0",
4
4
  "description": "ESLint Config for Shelf Projects",
5
5
  "license": "MIT",
6
6
  "repository": "shelfio/eslint-config",
@@ -33,8 +33,8 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@babel/eslint-parser": "7.18.2",
36
- "@typescript-eslint/eslint-plugin": "5.30.5",
37
- "@typescript-eslint/parser": "5.30.5",
36
+ "@typescript-eslint/eslint-plugin": "5.30.6",
37
+ "@typescript-eslint/parser": "5.30.6",
38
38
  "eslint-config-next": "11.1.2",
39
39
  "eslint-config-prettier": "8.5.0",
40
40
  "eslint-plugin-babel": "5.3.1",
@@ -43,6 +43,7 @@
43
43
  "eslint-plugin-jest-formatting": "3.1.0",
44
44
  "eslint-plugin-json-format": "2.0.1",
45
45
  "eslint-plugin-jsx": "0.1.0",
46
+ "eslint-plugin-node": "11.1.0",
46
47
  "eslint-plugin-prettier": "4.2.1",
47
48
  "eslint-plugin-react": "7.30.1",
48
49
  "eslint-plugin-react-hooks": "4.6.0",
@@ -0,0 +1,27 @@
1
+ {
2
+ "node/no-restricted-import": [
3
+ "error",
4
+ [
5
+ {
6
+ "name": "normalize-space-x",
7
+ "message": "Please use @shelf/fast-normalize-spaces instead!"
8
+ },
9
+ {
10
+ "name": "javascript-natural-sort",
11
+ "message": "Please use @shelf/fast-natural-order-by instead!"
12
+ },
13
+ {
14
+ "name": "natural-orderby",
15
+ "message": "Please use @shelf/fast-natural-order-by instead!"
16
+ },
17
+ {
18
+ "name": "uslug",
19
+ "message": "Please use @shelf/fast-uslug instead!"
20
+ },
21
+ {
22
+ "name": "fast-chunk-string",
23
+ "message": "Please use @shelf/fast-chunk-string instead!"
24
+ }
25
+ ]
26
+ ]
27
+ }
package/typescript.js CHANGED
@@ -12,6 +12,7 @@ const consistentTypeAssertions = require('./rules/consistent-type-assertions.jso
12
12
  const consistentTypeImports = require('./rules/consistent-type-imports.json');
13
13
  const youDontNeedLodashRules = require('./rules/you-dont-need-lodash.json');
14
14
  const typescriptRules = require('./rules/typescript');
15
+ const restrictedPackagesImportRules = require('./rules/restricted-packages-import.json');
15
16
 
16
17
  module.exports = {
17
18
  extends: [...commonExtends, 'plugin:you-dont-need-lodash-underscore/compatible'],
@@ -48,6 +49,7 @@ module.exports = {
48
49
  '@typescript-eslint/ban-ts-comment': 'off',
49
50
  '@typescript-eslint/no-non-null-assertion': 'off', // we want to allow using the "!" operator
50
51
  ...typescriptRules,
52
+ ...restrictedPackagesImportRules,
51
53
  },
52
54
  overrides: [allowRequireInConfigs, noExplicitReturnTypeInTests],
53
55
  };