@10stars/config 13.5.7 → 13.6.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.
@@ -1,11 +1,9 @@
1
- import type { ConfigArray } from "typescript-eslint"
2
-
3
1
  import { onlyBrowserWithoutCommon } from "./eslint.config.browser"
4
- import baseConfig from "./eslint.config.common"
2
+ import baseConfig, { type Config } from "./eslint.config.common"
5
3
  import { onlyNodeWithoutCommon } from "./eslint.config.node"
6
4
 
7
5
  export default [
8
6
  ...baseConfig,
9
7
  ...onlyBrowserWithoutCommon,
10
8
  ...onlyNodeWithoutCommon,
11
- ] satisfies ConfigArray
9
+ ] as Config[]
@@ -1,12 +1,11 @@
1
1
  import reactHooks from "@10stars/eslint-plugin-react-hooks"
2
+ import type { ConfigObject } from "@eslint/core"
2
3
  import eslintReact from "@eslint-react/eslint-plugin"
3
- import type { Linter } from "eslint"
4
4
  import reactPlugin from "eslint-plugin-react"
5
5
  // import * as reactCompiler from "eslint-plugin-react-compiler"
6
6
  import globals from "globals"
7
- import type { ConfigArray } from "typescript-eslint"
8
7
 
9
- import baseConfig from "./eslint.config.common"
8
+ import baseConfig, { type Config } from "./eslint.config.common"
10
9
 
11
10
  const addPluginReact = () =>
12
11
  [
@@ -69,7 +68,7 @@ const addPluginReact = () =>
69
68
  "react/jsx-sort-props": 1,
70
69
  },
71
70
  },
72
- ] satisfies Linter.Config[]
71
+ ] satisfies ConfigObject[] as Config[]
73
72
 
74
73
  const addPluginReactExtra = () =>
75
74
  [
@@ -80,7 +79,7 @@ const addPluginReactExtra = () =>
80
79
  "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": 0, // there are valid use cases
81
80
  },
82
81
  },
83
- ] satisfies Linter.Config[]
82
+ ] satisfies ConfigObject[] as Config[]
84
83
 
85
84
  const addStorybookOverrides = () =>
86
85
  ({
@@ -89,7 +88,7 @@ const addStorybookOverrides = () =>
89
88
  "react/jsx-no-bind": 0, // allow inline functions
90
89
  "@eslint-react/no-array-index-key": 0, // allow array index as key
91
90
  },
92
- }) satisfies Linter.Config
91
+ }) satisfies ConfigObject as Config
93
92
 
94
93
  export const onlyBrowserWithoutCommon = [
95
94
  {
@@ -101,9 +100,6 @@ export const onlyBrowserWithoutCommon = [
101
100
  ...addPluginReactExtra(),
102
101
  reactHooks.configs.recommended,
103
102
  addStorybookOverrides(),
104
- ] satisfies ConfigArray
103
+ ] as Config[]
105
104
 
106
- export default [
107
- ...baseConfig,
108
- ...onlyBrowserWithoutCommon,
109
- ] satisfies ConfigArray
105
+ export default [...baseConfig, ...onlyBrowserWithoutCommon] as Config[]
@@ -1,8 +1,9 @@
1
1
  import { builtinModules } from "node:module"
2
2
 
3
+ import type { ConfigObject } from "@eslint/core"
3
4
  import eslint from "@eslint/js"
4
5
  import stylistic from "@stylistic/eslint-plugin"
5
- import type { Linter } from "eslint"
6
+ import { defineConfig } from "eslint/config"
6
7
  import eslintConfigPrettier from "eslint-config-prettier"
7
8
  import importPlugin from "eslint-plugin-import"
8
9
  import noRelativeImportPaths from "eslint-plugin-no-relative-import-paths"
@@ -10,6 +11,8 @@ import * as regexpPlugin from "eslint-plugin-regexp"
10
11
  import simpleImportSort from "eslint-plugin-simple-import-sort"
11
12
  import tseslint from "typescript-eslint"
12
13
 
14
+ export type Config = Parameters<typeof defineConfig>[number]
15
+
13
16
  const addPluginRegexp = () =>
14
17
  [
15
18
  regexpPlugin.configs[`flat/recommended`],
@@ -19,7 +22,7 @@ const addPluginRegexp = () =>
19
22
  "regexp/use-ignore-case": 0,
20
23
  },
21
24
  },
22
- ] satisfies Linter.Config[]
25
+ ] satisfies ConfigObject[] as Config[]
23
26
 
24
27
  const addPluginNoRelativeImportPaths = () =>
25
28
  ({
@@ -32,7 +35,7 @@ const addPluginNoRelativeImportPaths = () =>
32
35
  { allowSameFolder: true, allowedDepth: 2 },
33
36
  ],
34
37
  },
35
- }) satisfies Linter.Config
38
+ }) satisfies ConfigObject as Config
36
39
 
37
40
  const addPluginImport = () =>
38
41
  [
@@ -64,7 +67,7 @@ const addPluginImport = () =>
64
67
  ],
65
68
  },
66
69
  },
67
- ] satisfies Linter.Config[]
70
+ ] satisfies ConfigObject[] as Config[]
68
71
 
69
72
  const addPluginSimpleImportSort = () =>
70
73
  ({
@@ -75,7 +78,7 @@ const addPluginSimpleImportSort = () =>
75
78
  "simple-import-sort/imports": 1,
76
79
  "simple-import-sort/exports": 1,
77
80
  },
78
- }) satisfies Linter.Config
81
+ }) satisfies ConfigObject as Config
79
82
 
80
83
  const addPluginStylistic = () =>
81
84
  ({
@@ -85,9 +88,9 @@ const addPluginStylistic = () =>
85
88
  rules: {
86
89
  "@stylistic/quotes": [1, `backtick`],
87
90
  },
88
- }) satisfies Linter.Config
91
+ }) satisfies ConfigObject as Config
89
92
 
90
- export default tseslint.config(
93
+ export default defineConfig(
91
94
  eslint.configs.recommended,
92
95
  tseslint.configs.strictTypeChecked,
93
96
  tseslint.configs.stylisticTypeChecked,
@@ -1,7 +1,7 @@
1
+ import type { ConfigObject } from "@eslint/core"
1
2
  import globals from "globals"
2
- import type { ConfigArray } from "typescript-eslint"
3
3
 
4
- import baseConfig from "./eslint.config.common"
4
+ import baseConfig, { type Config } from "./eslint.config.common"
5
5
 
6
6
  export const onlyNodeWithoutCommon = [
7
7
  {
@@ -9,9 +9,9 @@ export const onlyNodeWithoutCommon = [
9
9
  globals: globals.node,
10
10
  },
11
11
  },
12
- ] satisfies ConfigArray
12
+ ] satisfies ConfigObject[] as Config[]
13
13
 
14
14
  export default [
15
15
  ...baseConfig,
16
16
  ...onlyNodeWithoutCommon, //
17
- ] satisfies ConfigArray
17
+ ] as Config[]
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "name": "@10stars/config",
7
- "version": "13.5.7",
7
+ "version": "13.6.2",
8
8
  "author": "10stars.dev <web@alexandrov.co> (https://alexandrov.co)",
9
9
  "license": "MIT",
10
10
  "bin": {
@@ -25,10 +25,10 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@10stars/eslint-plugin-react-hooks": "^5.1.0",
28
- "@commitlint/cli": "^19.0.0",
29
- "@commitlint/config-conventional": "^19.0.0",
28
+ "@commitlint/cli": "^20.0.0",
29
+ "@commitlint/config-conventional": "^20.0.0",
30
30
  "@eslint/js": "^9.0.0",
31
- "@eslint-react/eslint-plugin": "^1.0.0",
31
+ "@eslint-react/eslint-plugin": "^2.0.0",
32
32
  "@stylistic/eslint-plugin": "^5.0.0",
33
33
  "@types/lodash": "^4.0.0",
34
34
  "@types/node": "^24.0.0",
@@ -46,7 +46,7 @@
46
46
  "husky": "^9.0.0",
47
47
  "prettier": "^3.0.0",
48
48
  "type-fest": "^5.0.0",
49
- "typescript": "~5.9.2",
49
+ "typescript": "~5.9.3",
50
50
  "typescript-eslint": "^8.39.0"
51
51
  }
52
52
  }
package/src/index.ts CHANGED
@@ -23,7 +23,13 @@ const getConfig = async (): Promise<Config> =>
23
23
 
24
24
  const getESLintCommonCmd = async () => {
25
25
  const isMonorepo = await checkIsMonorepo(cwd)
26
- return `--ext .ts,.tsx --no-error-on-unmatched-pattern ${isMonorepo ? `*/src */*.ts` : `src *.ts`} ${process.env.CI ? `--quiet` : ``}`
26
+ return `--ext .ts,.tsx --no-error-on-unmatched-pattern ${[
27
+ `src`,
28
+ `scripts`,
29
+ `*.ts`,
30
+ ]
31
+ .map((p) => (isMonorepo ? `*/${p}` : p))
32
+ .join(` `)} ${process.env.CI ? `--quiet` : ``}`
27
33
  }
28
34
 
29
35
  const typecheck = () => exec(`tsc --project ./tsconfig.json --watch --noEmit`)
@@ -7,7 +7,7 @@
7
7
 
8
8
  "compilerOptions": {
9
9
  "noEmit": true,
10
- "moduleResolution": "node10",
10
+ "moduleResolution": "bundler",
11
11
  "resolveJsonModule": true,
12
12
  "allowSyntheticDefaultImports": true,
13
13
  "allowJs": true,