@eslint-sets/eslint-config 6.3.0-beta.2 → 6.3.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/README.md CHANGED
@@ -212,6 +212,7 @@ export default eslintConfig({
212
212
  // Or with options:
213
213
  react: {
214
214
  reactCompiler: true, // React Compiler support
215
+ rsc: true, // RSC (React Server Components) rules (default: true)
215
216
  },
216
217
 
217
218
  // Regexp rules (default: true)
@@ -465,6 +466,7 @@ import eslintConfig from '@eslint-sets/eslint-config'
465
466
  export default eslintConfig({
466
467
  react: {
467
468
  reactCompiler: true,
469
+ rsc: true, // RSC rules for React Server Components
468
470
  },
469
471
  typescript: true,
470
472
  })
package/dist/cli/index.js CHANGED
File without changes
@@ -14,6 +14,11 @@ export interface ReactOptions extends OptionsOverrides, OptionsTypeScriptParserO
14
14
  * @default auto-detect
15
15
  */
16
16
  reactCompiler?: boolean;
17
+ /**
18
+ * Enable RSC (React Server Components) rules
19
+ * @default true
20
+ */
21
+ rsc?: boolean;
17
22
  }
18
23
  /**
19
24
  * React configuration
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/configs/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAI5G;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB,EAAE,8BAA8B,EAAE,0BAA0B;IACjH;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAEhB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACvB;AA4BD;;;GAGG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CA8JhF"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/configs/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAI5G;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB,EAAE,8BAA8B,EAAE,0BAA0B;IACjH;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAEhB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;CACb;AA8BD;;;GAGG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CA6KhF"}
@@ -1 +1 @@
1
- {"version":3,"file":"svelte.d.ts","sourceRoot":"","sources":["../../src/configs/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAQhD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACtD;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAqDlF"}
1
+ {"version":3,"file":"svelte.d.ts","sourceRoot":"","sources":["../../src/configs/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAQhD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACtD;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CA+DlF"}
package/dist/index.js CHANGED
@@ -856,7 +856,7 @@ function javascript(options = {}) {
856
856
  "no-class-assign": "error",
857
857
  "no-compare-neg-zero": "error",
858
858
  "no-cond-assign": ["error", "always"],
859
- "no-console": ["error", { allow: ["warn", "error"] }],
859
+ "no-console": ["error", { allow: ["info", "warn", "error"] }],
860
860
  "no-const-assign": "error",
861
861
  "no-control-regex": "error",
862
862
  "no-debugger": "error",
@@ -1585,7 +1585,7 @@ function prettier(options = {}) {
1585
1585
  function renameRules2(rules) {
1586
1586
  const result = {};
1587
1587
  for (const [key, value] of Object.entries(rules)) {
1588
- const newKey = key.replace("@eslint-react/dom/", "react-dom/").replace("@eslint-react/web-api/", "react-web-api/").replace("@eslint-react/naming-convention/", "react-naming-convention/").replace("@eslint-react/hooks-extra/", "react-hooks-extra/").replace("@eslint-react/", "react/");
1588
+ const newKey = key.replace("@eslint-react/dom/", "react-dom/").replace("@eslint-react/web-api/", "react-web-api/").replace("@eslint-react/naming-convention/", "react-naming-convention/").replace("@eslint-react/hooks-extra/", "react-hooks-extra/").replace("@eslint-react/rsc/", "react-rsc/").replace("@eslint-react/", "react/");
1589
1589
  if (value !== void 0) {
1590
1590
  result[newKey] = value;
1591
1591
  }
@@ -1599,7 +1599,8 @@ async function react(options = {}) {
1599
1599
  ignoresTypeAware = [`${GLOB_MD}/**`, GLOB_ASTRO_TS],
1600
1600
  overrides = {},
1601
1601
  tsconfigPath,
1602
- reactCompiler = hasReactCompiler()
1602
+ reactCompiler = hasReactCompiler(),
1603
+ rsc = true
1603
1604
  } = options;
1604
1605
  const [
1605
1606
  pluginReact,
@@ -1619,6 +1620,7 @@ async function react(options = {}) {
1619
1620
  const isUsingReactRouter = hasReactRouter();
1620
1621
  const isUsingNext = hasNextjs();
1621
1622
  const allPlugins = pluginReact.configs.all.plugins;
1623
+ const hasRscPlugin = !!allPlugins["@eslint-react/rsc"];
1622
1624
  const recommendedRules = renameRules2(pluginReact.configs.recommended?.rules || {});
1623
1625
  const typeAwareRules = {
1624
1626
  "react/no-leaked-conditional-rendering": "warn",
@@ -1634,6 +1636,7 @@ async function react(options = {}) {
1634
1636
  "react-hooks-extra": allPlugins["@eslint-react/hooks-extra"],
1635
1637
  "react-naming-convention": allPlugins["@eslint-react/naming-convention"],
1636
1638
  "react-refresh": pluginReactRefresh,
1639
+ ...hasRscPlugin ? { "react-rsc": allPlugins["@eslint-react/rsc"] } : {},
1637
1640
  "react-web-api": allPlugins["@eslint-react/web-api"]
1638
1641
  }
1639
1642
  },
@@ -1653,6 +1656,10 @@ async function react(options = {}) {
1653
1656
  ...recommendedRules,
1654
1657
  // Additional rules
1655
1658
  "react/prefer-react-namespace-import": "error",
1659
+ // RSC (React Server Components) rules - only if plugin is available
1660
+ ...rsc && hasRscPlugin ? {
1661
+ "react-rsc/function-definition": "error"
1662
+ } : {},
1656
1663
  // React hooks rules
1657
1664
  "react-hooks/rules-of-hooks": "error",
1658
1665
  "react-hooks/exhaustive-deps": "warn",
@@ -1720,7 +1727,12 @@ async function react(options = {}) {
1720
1727
  rules: {
1721
1728
  // Disables rules that are already handled by TypeScript
1722
1729
  "react-dom/no-string-style-prop": "off",
1723
- "react-dom/no-unknown-property": "off"
1730
+ "react-dom/no-unknown-property": "off",
1731
+ // Additional TypeScript-specific rule disables (align with antfu)
1732
+ "react/jsx-no-duplicate-props": "off",
1733
+ "react/jsx-no-undef": "off",
1734
+ "react/jsx-uses-react": "off",
1735
+ "react/jsx-uses-vars": "off"
1724
1736
  }
1725
1737
  }
1726
1738
  ];
@@ -2091,6 +2103,16 @@ async function svelte(options = {}) {
2091
2103
  name: "eslint-sets/svelte",
2092
2104
  files: [GLOB_SVELTE],
2093
2105
  languageOptions: {
2106
+ globals: {
2107
+ // Svelte 5 Runes
2108
+ $state: "readonly",
2109
+ $derived: "readonly",
2110
+ $effect: "readonly",
2111
+ $props: "readonly",
2112
+ $bindable: "readonly",
2113
+ $inspect: "readonly",
2114
+ $host: "readonly"
2115
+ },
2094
2116
  parser: svelteParser,
2095
2117
  parserOptions: {
2096
2118
  ecmaVersion: "latest",
package/package.json CHANGED
@@ -1,158 +1,156 @@
1
1
  {
2
- "name": "@eslint-sets/eslint-config",
3
- "description": "Modern ESLint config with flat config support for Vue, React, Svelte, TypeScript, Next.js, Nuxt, Astro, Angular, UnoCSS and more",
4
- "type": "module",
5
- "version": "6.3.0-beta.2",
6
- "packageManager": "pnpm@9.0.6",
7
- "bin": {
8
- "eslint-sets": "./dist/cli/index.js"
9
- },
10
- "main": "./dist/index.js",
11
- "types": "./dist/index.d.ts",
12
- "exports": {
13
- ".": {
14
- "types": "./dist/index.d.ts",
15
- "import": "./dist/index.js"
16
- },
17
- "./cli": {
18
- "types": "./dist/cli/index.d.ts",
19
- "import": "./dist/cli/index.js"
20
- },
21
- "./package.json": "./package.json"
22
- },
23
- "files": [
24
- "README.md",
25
- "dist"
26
- ],
27
- "scripts": {
28
- "build": "jiti scripts/build.ts",
29
- "dev": "jiti scripts/build.ts && tsc --watch",
30
- "gen": "jiti scripts/typegen.ts",
31
- "lint": "eslint .",
32
- "lint:fix": "eslint . --fix",
33
- "typecheck": "tsc --noEmit",
34
- "test": "vitest run",
35
- "test:watch": "vitest",
36
- "test:coverage": "vitest run --coverage",
37
- "inspector": "@eslint/config-inspector",
38
- "prepublishOnly": "pnpm build",
39
- "release": "bumpp && pnpm publish"
40
- },
41
- "publishConfig": {
42
- "registry": "https://registry.npmjs.org",
43
- "access": "public"
44
- },
45
- "dependencies": {
46
- "@clack/prompts": "^0.10.1",
47
- "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
48
- "@eslint/js": "^9.22.0",
49
- "@stylistic/eslint-plugin": "^5.10.0",
50
- "@typescript-eslint/eslint-plugin": "^8.26.1",
51
- "@typescript-eslint/parser": "^8.26.1",
52
- "@vitest/eslint-plugin": "^1.6.13",
53
- "eslint-config-prettier": "^10.1.8",
54
- "eslint-merge-processors": "^2.0.0",
55
- "eslint-plugin-import-lite": "^0.5.2",
56
- "eslint-plugin-jsdoc": "^61.7.1",
57
- "eslint-plugin-jsonc": "^2.21.1",
58
- "eslint-plugin-n": "^17.24.0",
59
- "eslint-plugin-no-only-tests": "^3.3.0",
60
- "eslint-plugin-perfectionist": "^4.15.1",
61
- "eslint-plugin-prettier": "^5.2.6",
62
- "eslint-plugin-regexp": "^2.10.0",
63
- "eslint-plugin-solid": "^0.14.5",
64
- "eslint-plugin-toml": "^1.3.1",
65
- "eslint-plugin-unicorn": "^56.0.1",
66
- "eslint-plugin-unused-imports": "^4.1.4",
67
- "eslint-plugin-vue": "^9.33.0",
68
- "eslint-plugin-yml": "^1.19.1",
69
- "globals": "^17.4.0",
70
- "jsonc-eslint-parser": "^2.4.2",
71
- "local-pkg": "^1.0.0",
72
- "toml-eslint-parser": "^1.0.3",
73
- "vue-eslint-parser": "^10.4.0",
74
- "yaml-eslint-parser": "^1.3.2"
75
- },
76
- "devDependencies": {
77
- "@types/node": "^22.13.17",
78
- "@vitest/coverage-v8": "^4.1.2",
79
- "bumpp": "^10.1.1",
80
- "esbuild": "^0.27.4",
81
- "eslint": "^9.22.0",
82
- "eslint-typegen": "^2.3.1",
83
- "jiti": "^2.6.1",
84
- "prettier": "^3.5.3",
85
- "typescript": "~5.9.3",
86
- "vitest": "^4.1.2"
87
- },
88
- "peerDependencies": {
89
- "eslint": "^9.10.0 || ^9.22.0",
90
- "prettier": "^3.5.3",
91
- "typescript": ">=5.0.0"
92
- },
93
- "peerDependenciesMeta": {
94
- "prettier": {
95
- "optional": true
96
- },
97
- "typescript": {
98
- "optional": true
99
- }
100
- },
101
- "optionalDependencies": {
102
- "@angular-eslint/eslint-plugin": "^21.3.1",
103
- "@angular-eslint/eslint-plugin-template": "^21.3.1",
104
- "@angular-eslint/template-parser": "^21.3.1",
105
- "@e18e/eslint-plugin": "^0.2.0",
106
- "@eslint-react/eslint-plugin": "^1.40.4",
107
- "@eslint/markdown": "^6.6.0",
108
- "@next/eslint-plugin-next": ">=15.0.8",
109
- "@unocss/eslint-plugin": ">=0.60.4",
110
- "@vue/compiler-sfc": "^3.5.31",
111
- "astro-eslint-parser": "^1.0.3",
112
- "eslint-plugin-astro": "^1.2.4",
113
- "eslint-plugin-command": "^3.2.1",
114
- "eslint-plugin-erasable-syntax-only": "^0.4.0",
115
- "eslint-plugin-format": "^0.1.3",
116
- "eslint-plugin-jsx-a11y": "^6.10.2",
117
- "eslint-plugin-pnpm": "^1.1.2",
118
- "eslint-plugin-react-hooks": "^5.2.0",
119
- "eslint-plugin-react-hooks-extra": "^2.13.0",
120
- "eslint-plugin-react-refresh": "^0.5.2",
121
- "eslint-plugin-svelte": "^2.46.1",
122
- "eslint-plugin-vuejs-accessibility": "^2.4.2",
123
- "eslint-processor-vue-blocks": "^2.0.0",
124
- "svelte": "^5.25.12",
125
- "svelte-eslint-parser": "^1.0.1"
126
- },
127
- "engines": {
128
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
129
- },
130
- "keywords": [
131
- "eslint",
132
- "eslint-config",
133
- "eslint-flat-config",
134
- "vue",
135
- "react",
136
- "svelte",
137
- "typescript",
138
- "nextjs",
139
- "nuxt",
140
- "astro",
141
- "angular",
142
- "solid",
143
- "unocss",
144
- "accessibility",
145
- "a11y",
146
- "cli"
147
- ],
148
- "license": "MIT",
149
- "author": "saqqdy <https://github.com/saqqdy>",
150
- "homepage": "https://github.com/saqqdy/eslint-sets#readme",
151
- "bugs": {
152
- "url": "https://github.com/saqqdy/eslint-sets/issues"
153
- },
154
- "repository": {
155
- "type": "git",
156
- "url": "git+https://github.com/saqqdy/eslint-sets.git"
157
- }
158
- }
2
+ "name": "@eslint-sets/eslint-config",
3
+ "description": "Modern ESLint config with flat config support for Vue, React, Svelte, TypeScript, Next.js, Nuxt, Astro, Angular, UnoCSS and more",
4
+ "type": "module",
5
+ "version": "6.3.0",
6
+ "bin": {
7
+ "eslint-sets": "./dist/cli/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./cli": {
17
+ "types": "./dist/cli/index.d.ts",
18
+ "import": "./dist/cli/index.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "files": [
23
+ "README.md",
24
+ "dist"
25
+ ],
26
+ "publishConfig": {
27
+ "registry": "https://registry.npmjs.org",
28
+ "access": "public"
29
+ },
30
+ "dependencies": {
31
+ "@clack/prompts": "^0.10.1",
32
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
33
+ "@eslint/js": "^9.22.0",
34
+ "@stylistic/eslint-plugin": "^5.10.0",
35
+ "@typescript-eslint/eslint-plugin": "^8.26.1",
36
+ "@typescript-eslint/parser": "^8.26.1",
37
+ "@vitest/eslint-plugin": "^1.6.13",
38
+ "eslint-config-prettier": "^10.1.8",
39
+ "eslint-merge-processors": "^2.0.0",
40
+ "eslint-plugin-import-lite": "^0.5.2",
41
+ "eslint-plugin-jsdoc": "^61.7.1",
42
+ "eslint-plugin-jsonc": "^2.21.1",
43
+ "eslint-plugin-n": "^17.24.0",
44
+ "eslint-plugin-no-only-tests": "^3.3.0",
45
+ "eslint-plugin-perfectionist": "^4.15.1",
46
+ "eslint-plugin-prettier": "^5.2.6",
47
+ "eslint-plugin-regexp": "^2.10.0",
48
+ "eslint-plugin-solid": "^0.14.5",
49
+ "eslint-plugin-toml": "^1.3.1",
50
+ "eslint-plugin-unicorn": "^56.0.1",
51
+ "eslint-plugin-unused-imports": "^4.1.4",
52
+ "eslint-plugin-vue": "^9.33.0",
53
+ "eslint-plugin-yml": "^1.19.1",
54
+ "globals": "^17.4.0",
55
+ "jsonc-eslint-parser": "^2.4.2",
56
+ "local-pkg": "^1.0.0",
57
+ "toml-eslint-parser": "^1.0.3",
58
+ "vue-eslint-parser": "^10.4.0",
59
+ "yaml-eslint-parser": "^1.3.2"
60
+ },
61
+ "devDependencies": {
62
+ "@types/node": "^22.13.17",
63
+ "@vitest/coverage-v8": "^4.1.2",
64
+ "bumpp": "^10.1.1",
65
+ "esbuild": "^0.27.4",
66
+ "eslint": "^9.22.0",
67
+ "eslint-typegen": "^2.3.1",
68
+ "jiti": "^2.6.1",
69
+ "prettier": "^3.5.3",
70
+ "typescript": "~5.9.3",
71
+ "vitest": "^4.1.2"
72
+ },
73
+ "peerDependencies": {
74
+ "eslint": "^9.10.0 || ^9.22.0",
75
+ "prettier": "^3.5.3",
76
+ "typescript": ">=5.0.0"
77
+ },
78
+ "peerDependenciesMeta": {
79
+ "prettier": {
80
+ "optional": true
81
+ },
82
+ "typescript": {
83
+ "optional": true
84
+ }
85
+ },
86
+ "optionalDependencies": {
87
+ "@angular-eslint/eslint-plugin": "^21.3.1",
88
+ "@angular-eslint/eslint-plugin-template": "^21.3.1",
89
+ "@angular-eslint/template-parser": "^21.3.1",
90
+ "@e18e/eslint-plugin": "^0.2.0",
91
+ "@eslint-react/eslint-plugin": "^1.40.4 || ^2.0.0 || ^3.0.0",
92
+ "@eslint/markdown": "^6.6.0",
93
+ "@next/eslint-plugin-next": ">=15.0.8",
94
+ "@unocss/eslint-plugin": ">=0.60.4",
95
+ "@vue/compiler-sfc": "^3.5.31",
96
+ "astro-eslint-parser": "^1.0.3",
97
+ "eslint-plugin-astro": "^1.2.4",
98
+ "eslint-plugin-command": "^3.2.1",
99
+ "eslint-plugin-erasable-syntax-only": "^0.4.0",
100
+ "eslint-plugin-format": "^0.1.3",
101
+ "eslint-plugin-jsx-a11y": "^6.10.2",
102
+ "eslint-plugin-pnpm": "^1.1.2",
103
+ "eslint-plugin-react-hooks": "^5.2.0",
104
+ "eslint-plugin-react-hooks-extra": "^2.13.0",
105
+ "eslint-plugin-react-refresh": "^0.5.2",
106
+ "eslint-plugin-svelte": "^2.46.1",
107
+ "eslint-plugin-vuejs-accessibility": "^2.4.2",
108
+ "eslint-processor-vue-blocks": "^2.0.0",
109
+ "svelte": "^5.25.12",
110
+ "svelte-eslint-parser": "^1.0.1"
111
+ },
112
+ "engines": {
113
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
114
+ },
115
+ "keywords": [
116
+ "eslint",
117
+ "eslint-config",
118
+ "eslint-flat-config",
119
+ "vue",
120
+ "react",
121
+ "svelte",
122
+ "typescript",
123
+ "nextjs",
124
+ "nuxt",
125
+ "astro",
126
+ "angular",
127
+ "solid",
128
+ "unocss",
129
+ "accessibility",
130
+ "a11y",
131
+ "cli"
132
+ ],
133
+ "license": "MIT",
134
+ "author": "saqqdy <https://github.com/saqqdy>",
135
+ "homepage": "https://github.com/saqqdy/eslint-sets#readme",
136
+ "bugs": {
137
+ "url": "https://github.com/saqqdy/eslint-sets/issues"
138
+ },
139
+ "repository": {
140
+ "type": "git",
141
+ "url": "git+https://github.com/saqqdy/eslint-sets.git"
142
+ },
143
+ "scripts": {
144
+ "build": "jiti scripts/build.ts",
145
+ "dev": "jiti scripts/build.ts && tsc --watch",
146
+ "gen": "jiti scripts/typegen.ts",
147
+ "lint": "eslint .",
148
+ "lint:fix": "eslint . --fix",
149
+ "typecheck": "tsc --noEmit",
150
+ "test": "vitest run",
151
+ "test:watch": "vitest",
152
+ "test:coverage": "vitest run --coverage",
153
+ "inspector": "@eslint/config-inspector",
154
+ "release": "bumpp && pnpm publish"
155
+ }
156
+ }