@leancodepl/eslint-config 9.6.6 → 9.7.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [9.7.1](https://github.com/leancodepl/js_corelibrary/compare/v9.7.0...v9.7.1) (2026-01-20)
7
+
8
+ ### Bug Fixes
9
+
10
+ - limit eslint plugin perfectionist version
11
+ ([e658832](https://github.com/leancodepl/js_corelibrary/commit/e65883274e66bd82b44ae2a65e29c1f4aa6a275e))
12
+
13
+ # Change Log
14
+
15
+ All notable changes to this project will be documented in this file. See
16
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
17
+
18
+ # [9.7.0](https://github.com/leancodepl/js_corelibrary/compare/v9.6.6...v9.7.0) (2025-12-18)
19
+
20
+ ### Bug Fixes
21
+
22
+ - add eslint-config-prettier
23
+ ([c671ee8](https://github.com/leancodepl/js_corelibrary/commit/c671ee8b0202014fc3b0f3c31268af5f012328fb))
24
+ - make eslint configs independent
25
+ ([157c92b](https://github.com/leancodepl/js_corelibrary/commit/157c92b4cc68e870a210d754814c383aba859f0a))
26
+ - make local eslint config run directly from built js
27
+ ([a82e48a](https://github.com/leancodepl/js_corelibrary/commit/a82e48a758d2d40352f832fba260759e3b77e70e))
28
+
29
+ ### Features
30
+
31
+ - add switch-case-braces eslint rule
32
+ ([f3bb74e](https://github.com/leancodepl/js_corelibrary/commit/f3bb74e53c8e8f40defa8bef409a7f1cf2329d73))
33
+ - rewrite esling-config with typescript
34
+ ([92d53fe](https://github.com/leancodepl/js_corelibrary/commit/92d53fedc6d3ced2feaa81b803bdb9c299de537c))
35
+
36
+ # Change Log
37
+
38
+ All notable changes to this project will be documented in this file. See
39
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
40
+
6
41
  ## [9.6.6](https://github.com/leancodepl/js_corelibrary/compare/v9.6.5...v9.6.6) (2025-11-18)
7
42
 
8
43
  **Note:** Version bump only for package @leancodepl/eslint-config
package/jest.config.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ displayName: "@leancodepl/eslint-config",
3
+ moduleFileExtensions: ["js"],
4
+ testEnvironment: "node",
5
+ coverageDirectory: "../../../coverage/packages/linters/eslint-config",
6
+ testMatch: ["<rootDir>/src/**/__tests__/**/*.spec.js"],
7
+ transform: {},
8
+ }
package/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "@leancodepl/eslint-config",
3
- "version": "9.6.6",
3
+ "version": "9.7.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "src/index.js",
6
6
  "dependencies": {
7
+ "@leancodepl/eslint-plugin": "9.7.1",
7
8
  "eslint-plugin-import": ">=2.31.0",
8
9
  "eslint-plugin-jsx-a11y": ">=6.10.0",
9
- "eslint-plugin-perfectionist": ">=4.0.0",
10
+ "eslint-plugin-perfectionist": ">=4.0.0 <5.0.0",
10
11
  "eslint-plugin-react-hooks": ">=5.2.0",
11
12
  "eslint-plugin-unused-imports": ">=4.1.0",
12
13
  "globals": ">=15.0.0"
13
14
  },
14
15
  "peerDependencies": {
16
+ "@types/eslint-plugin-jsx-a11y": ">=6.10.0",
15
17
  "eslint": ">=8.9.0",
16
18
  "eslint-config-prettier": ">=9.1.0",
17
19
  "eslint-plugin-react": ">=7.34.1",
package/project.json CHANGED
@@ -19,6 +19,13 @@
19
19
  "publish": {
20
20
  "command": "node tools/scripts/publish.mjs @leancodepl/eslint-config {args.registry} {args.ver} {args.tag}",
21
21
  "dependsOn": ["build"]
22
+ },
23
+ "test": {
24
+ "executor": "@nx/jest:jest",
25
+ "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
26
+ "options": {
27
+ "jestConfig": "packages/linters/eslint-config/jest.config.js"
28
+ }
22
29
  }
23
30
  }
24
31
  }
package/src/index.js CHANGED
@@ -1,11 +1,6 @@
1
- const a11y = require("./lib/a11y")
2
- const base = require("./lib/base")
3
- const baseReact = require("./lib/base-react")
4
- const imports = require("./lib/imports")
1
+ const { a11y } = require("./lib/a11y.js")
2
+ const { baseReact } = require("./lib/base-react.js")
3
+ const { base } = require("./lib/base.js")
4
+ const { imports } = require("./lib/imports.js")
5
5
 
6
- module.exports = {
7
- imports,
8
- base,
9
- baseReact,
10
- a11y,
11
- }
6
+ module.exports = { a11y, base, baseReact, imports }
package/src/lib/a11y.js CHANGED
@@ -1,3 +1,10 @@
1
1
  const jsxA11y = require("eslint-plugin-jsx-a11y")
2
2
 
3
- module.exports = [jsxA11y.flatConfigs.recommended]
3
+ /**
4
+ * @typedef {import('@typescript-eslint/utils').TSESLint.FlatConfig.Config} Config
5
+ */
6
+
7
+ /** @type {Config[]} */
8
+ const a11y = [jsxA11y.flatConfigs.recommended]
9
+
10
+ module.exports = { a11y }
@@ -2,7 +2,12 @@ const react = require("eslint-plugin-react")
2
2
  const reactHooks = require("eslint-plugin-react-hooks")
3
3
  const globals = require("globals")
4
4
 
5
- module.exports = [
5
+ /**
6
+ * @typedef {import('@typescript-eslint/utils').TSESLint.FlatConfig.Config} Config
7
+ */
8
+
9
+ /** @type {Config[]} */
10
+ const baseReact = [
6
11
  {
7
12
  plugins: {
8
13
  react,
@@ -38,6 +43,11 @@ module.exports = [
38
43
 
39
44
  "react-hooks/exhaustive-deps": "error",
40
45
  "react-hooks/rules-of-hooks": "error",
46
+
47
+ "react/jsx-uses-react": "off",
48
+ "react/jsx-uses-vars": "error",
41
49
  },
42
50
  },
43
51
  ]
52
+
53
+ module.exports = { baseReact }
package/src/lib/base.js CHANGED
@@ -1,9 +1,23 @@
1
+ const parser = require("@typescript-eslint/parser")
2
+ const eslintConfigPrettier = require("eslint-config-prettier")
1
3
  const perfectionist = require("eslint-plugin-perfectionist")
4
+ const tseslint = require("typescript-eslint")
5
+ const { leancodePlugin } = require("@leancodepl/eslint-plugin")
2
6
 
3
- module.exports = [
7
+ /**
8
+ * @typedef {import('@typescript-eslint/utils').TSESLint.FlatConfig.Config} Config
9
+ */
10
+
11
+ /** @type {Config[]} */
12
+ const base = [
4
13
  {
14
+ languageOptions: {
15
+ parser: tseslint.parser,
16
+ },
5
17
  plugins: {
18
+ "@typescript-eslint": tseslint.plugin,
6
19
  perfectionist,
20
+ leancode: leancodePlugin,
7
21
  },
8
22
  rules: {
9
23
  curly: ["error", "multi-line", "consistent"],
@@ -12,6 +26,9 @@ module.exports = [
12
26
  "no-eval": "error",
13
27
  "no-useless-rename": "error",
14
28
  "arrow-body-style": ["error", "as-needed"],
29
+ "no-case-declarations": "off",
30
+
31
+ "leancode/switch-case-braces": "error",
15
32
 
16
33
  "@typescript-eslint/no-empty-function": "off",
17
34
  "@typescript-eslint/no-empty-object-type": "off",
@@ -55,4 +72,7 @@ module.exports = [
55
72
  ],
56
73
  },
57
74
  },
75
+ eslintConfigPrettier,
58
76
  ]
77
+
78
+ module.exports = { base }
@@ -1,13 +1,16 @@
1
- const imports = require("eslint-plugin-import")
2
- const perfectionist = require("eslint-plugin-perfectionist")
1
+ const importsPlugin = require("eslint-plugin-import")
3
2
  const unusedImports = require("eslint-plugin-unused-imports")
4
3
 
5
- module.exports = [
4
+ /**
5
+ * @typedef {import('@typescript-eslint/utils').TSESLint.FlatConfig.Config} Config
6
+ */
7
+
8
+ /** @type {Config[]} */
9
+ const imports = [
6
10
  {
7
11
  plugins: {
8
12
  "unused-imports": unusedImports,
9
- import: imports,
10
- perfectionist,
13
+ import: importsPlugin,
11
14
  },
12
15
  rules: {
13
16
  "@typescript-eslint/no-unused-vars": "off",
@@ -60,8 +63,6 @@ module.exports = [
60
63
  order: "asc",
61
64
  },
62
65
  ],
63
- "react/jsx-uses-react": "off",
64
- "react/jsx-uses-vars": "error",
65
66
  "unused-imports/no-unused-imports": "warn",
66
67
  "unused-imports/no-unused-vars": [
67
68
  "warn",
@@ -75,3 +76,5 @@ module.exports = [
75
76
  },
76
77
  },
77
78
  ]
79
+
80
+ module.exports = { imports }