@kontent-ai/eslint-config 1.0.2 → 2.0.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.
Files changed (4) hide show
  1. package/index.js +28 -42
  2. package/package.json +7 -11
  3. package/react.js +1 -19
  4. package/jest.js +0 -26
package/index.js CHANGED
@@ -14,58 +14,44 @@ module.exports = {
14
14
  },
15
15
  plugins: [
16
16
  "@typescript-eslint",
17
- "import",
18
- "simple-import-sort",
19
- ],
20
- extends: [
21
- "eslint:recommended",
22
- "plugin:@typescript-eslint/eslint-recommended",
23
- "plugin:import/recommended",
24
- "plugin:import/typescript",
25
17
  ],
26
18
  rules: {
27
- "import/no-deprecated": "error",
28
- "import/no-empty-named-blocks": "error",
29
- "import/no-extraneous-dependencies": "error",
30
- "import/no-mutable-exports": "error",
31
- "import/no-absolute-path": "error",
32
- "import/no-useless-path-segments": "error",
33
- "import/first": "error",
34
- "import/newline-after-import": "error",
35
- "import/no-unresolved": "off",
36
-
37
- "simple-import-sort/imports": "error",
19
+ "no-duplicate-imports": "error",
20
+ "no-promise-executor-return": "error",
21
+ "no-unexpected-multiline": "error",
22
+ "no-unreachable-loop": "error",
23
+ "no-useless-backreference": "error",
38
24
 
39
- "no-dupe-class-members": "off",
40
- "@typescript-eslint/no-dupe-class-members": "error",
41
- "@typescript-eslint/consistent-type-assertions": "error",
42
- "@typescript-eslint/consistent-indexed-object-style": "error",
43
- "no-unused-expressions": "off",
44
- "@typescript-eslint/no-unused-expressions": "error",
45
- "no-unused-vars": "off",
46
- "@typescript-eslint/no-unused-vars": "error",
47
- "@typescript-eslint/prefer-literal-enum-member": "error",
48
- "@typescript-eslint/prefer-enum-initializers": "error",
49
- "no-loop-func": "off",
50
25
  "@typescript-eslint/no-loop-func": "error",
51
- "@typescript-eslint/no-require-imports": "error",
52
- "@typescript-eslint/no-confusing-non-null-assertion": "error",
53
- "no-useless-constructor": "off",
54
- "@typescript-eslint/no-useless-constructor": "error",
55
- "@typescript-eslint/no-duplicate-enum-values": "error",
56
26
  "@typescript-eslint/no-redundant-type-constituents": "error",
57
- "@typescript-eslint/no-throw-literal": "error",
58
27
  "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
59
28
  "@typescript-eslint/no-unnecessary-qualifier": "error",
60
29
  "@typescript-eslint/no-unnecessary-condition": "error",
61
- "@typescript-eslint/no-unsafe-declaration-merging": "error",
62
30
  "@typescript-eslint/prefer-includes": "error",
63
31
  "@typescript-eslint/prefer-return-this-type": "error",
64
32
  "@typescript-eslint/prefer-string-starts-ends-with": "error",
65
- "@typescript-eslint/prefer-for-of": "error",
66
- "@typescript-eslint/prefer-function-type": "error",
67
- "@typescript-eslint/prefer-optional-chain": "error",
68
- "@typescript-eslint/prefer-reduce-type-parameter": "error",
69
- "@typescript-eslint/prefer-ts-expect-error": "error",
33
+ "@typescript-eslint/await-thenable": "error",
34
+ "@typescript-eslint/no-floating-promises": "error",
35
+ "@typescript-eslint/no-for-in-array": "error",
36
+ "@typescript-eslint/no-misused-promises": "error",
37
+ "@typescript-eslint/no-unsafe-argument": "error",
38
+ "@typescript-eslint/no-unsafe-assignment": "error",
39
+ "@typescript-eslint/no-unsafe-call": "error",
40
+ "@typescript-eslint/no-unsafe-member-access": "error",
41
+ "@typescript-eslint/no-unsafe-return": "error",
42
+ "@typescript-eslint/prefer-nullish-coalescing": "error",
43
+ "@typescript-eslint/restrict-plus-operands": "error",
44
+ "@typescript-eslint/restrict-template-expressions": "error",
45
+ "@typescript-eslint/switch-exhaustiveness-check": "error",
46
+ "@typescript-eslint/unbound-method": "error",
47
+ "@typescript-eslint/no-duplicate-enum-values": "error",
48
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
49
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
50
+ "@typescript-eslint/unified-signatures": "error",
51
+ "@typescript-eslint/promise-function-async": "error",
52
+ "@typescript-eslint/require-array-sort-compare": "error",
53
+ "@typescript-eslint/no-mixed-enums": "error",
54
+ "@typescript-eslint/no-unsafe-enum-comparison": "error",
55
+ "@typescript-eslint/strict-boolean-expressions": "warn",
70
56
  },
71
57
  };
package/package.json CHANGED
@@ -1,22 +1,18 @@
1
1
  {
2
2
  "name": "@kontent-ai/eslint-config",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "description": "Eslint configuration used for packages in Kontent.ai",
5
5
  "main": "index.js",
6
6
  "private": false,
7
+ "type": "module",
7
8
  "scripts": {},
8
9
  "author": "Jiri Lojda",
9
10
  "license": "SEE LICENSE IN LICENSE.md",
10
11
  "dependencies": {
11
- "@typescript-eslint/parser": "^6.19.0"
12
- },
13
- "peerDependencies": {
14
- "@typescript-eslint/eslint-plugin": "^6.19.0",
15
- "eslint": "^8.0.0",
16
- "eslint-plugin-import": "^2.29.0",
17
- "eslint-plugin-jest": "^27.0.0",
18
- "eslint-plugin-react": "^7.0.0",
19
- "eslint-plugin-react-hooks": "^4.0.0",
20
- "eslint-plugin-simple-import-sort": "^10.0.0"
12
+ "@typescript-eslint/parser": "^8.1.0",
13
+ "@typescript-eslint/eslint-plugin": "^8.1.0",
14
+ "eslint": "^9.9.0",
15
+ "eslint-plugin-jest": "^28.8.0",
16
+ "eslint-plugin-react": "^7.35.0"
21
17
  }
22
18
  }
package/react.js CHANGED
@@ -1,7 +1,6 @@
1
1
  module.exports = {
2
2
  plugins: [
3
3
  "react",
4
- "react-hooks",
5
4
  ],
6
5
 
7
6
  extends: [
@@ -9,22 +8,10 @@ module.exports = {
9
8
  ],
10
9
 
11
10
  rules: {
12
- "react/hook-use-state": "error",
13
11
  "react/jsx-boolean-value": "error",
14
- "react/jsx-closing-bracket-location": "error",
15
- "react/jsx-closing-tag-location": "error",
16
- "react/jsx-curly-brace-presence": "error",
17
- "react/jsx-curly-spacing": [
18
- "error", {
19
- when: "never",
20
- attributes: true,
21
- children: true,
22
- },
23
- ],
24
12
  "react/jsx-equals-spacing": "error",
25
13
  "react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
26
14
  "react/jsx-first-prop-new-line": ["error", "multiline"],
27
- "react/jsx-fragments": "error",
28
15
  "react/jsx-indent-props": ["error", 2],
29
16
  "react/jsx-max-props-per-line": "error",
30
17
  "react/jsx-no-bind": [
@@ -52,7 +39,6 @@ module.exports = {
52
39
  },
53
40
  ],
54
41
  "react/no-access-state-in-setstate": "error",
55
- "react/no-danger": "error",
56
42
  "react/no-redundant-should-component-update": "error",
57
43
  "react/no-unsafe": "error",
58
44
  "react/no-unused-state": "error",
@@ -60,12 +46,8 @@ module.exports = {
60
46
  "react/no-typos": "error",
61
47
  "react/no-this-in-sfc": "error",
62
48
  "react/self-closing-comp": "error",
63
- "react/void-dom-elements-no-children": "error",
64
49
  "react/style-prop-object": "error",
65
- "react/jsx-no-leaked-render": "off",
50
+ "react/jsx-no-leaked-render": "error",
66
51
  "react/prefer-stateless-function": "error",
67
-
68
- "react-hooks/rules-of-hooks": "error",
69
- "react-hooks/exhaustive-deps": "error",
70
52
  },
71
53
  }
package/jest.js DELETED
@@ -1,26 +0,0 @@
1
- module.exports = {
2
- plugins: [
3
- "jest",
4
- ],
5
-
6
- extends: [
7
- "@kontent-ai",
8
- "plugin:jest/recommended",
9
- "plugin:jest/style",
10
- ],
11
-
12
- rules: {
13
- "jest/expect-expect": "error",
14
- "jest/no-duplicate-hooks": "error",
15
- "jest/no-test-return-statement": "error",
16
- "jest/prefer-called-with": "error",
17
- "jest/prefer-comparison-matcher": "error",
18
- "jest/prefer-equality-matcher": "error",
19
- "jest/prefer-expect-assertions": ["error", { onlyFunctionsWithAsyncKeyword: true }],
20
- "jest/prefer-hooks-on-top": "error",
21
- "jest/prefer-strict-equal": "error",
22
- "jest/prefer-todo": "error",
23
- "jest/require-top-level-describe": "error",
24
-
25
- },
26
- };