@open-turo/eslint-config-typescript 18.1.13 → 18.1.14-pr-461.404.1.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/index.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  // @ts-check
2
2
 
3
3
  /** @import { ConfigWithExtends } from "typescript-eslint" */
4
+ /** @import { ParserOptions } from "@typescript-eslint/parser"; */
4
5
  const eslint = require("@eslint/js");
5
6
  const tsParser = require("@typescript-eslint/parser");
6
7
  const vitestPlugin = require("@vitest/eslint-plugin");
@@ -27,6 +28,7 @@ const FILES_TEST = [
27
28
 
28
29
  const typescriptLanguageOptions = () => ({
29
30
  parser: tsParser,
31
+ /** @type {ParserOptions} */
30
32
  parserOptions: {
31
33
  projectService: true,
32
34
  tsconfigRootDir: process.cwd(),
@@ -44,6 +46,7 @@ const javascriptConfig = (ecmaVersion = "latest") =>
44
46
  eslintConfig.defineConfig(eslint.configs.recommended, {
45
47
  files: [FILES_JS],
46
48
  languageOptions: {
49
+ /** @type {ParserOptions} */
47
50
  parserOptions: {
48
51
  ecmaVersion,
49
52
  },
@@ -136,7 +139,6 @@ const typescriptConfig = () =>
136
139
  eslintConfig.defineConfig({
137
140
  extends: [
138
141
  tseslint.configs.recommendedTypeChecked,
139
- // @ts-expect-error -- We are inferring the types of this import from runtime, but the rule values are inferred as `string` instead of `RuleEntry` ("off" | "warn" | "error")
140
142
  getImportPluginFlatConfigs().typescript,
141
143
  ],
142
144
  files: [FILES_TS, FILES_TSX],
package/package.json CHANGED
@@ -4,20 +4,20 @@
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@eslint/js": "9.39.1",
7
- "@typescript-eslint/eslint-plugin": "8.46.3",
8
- "@typescript-eslint/parser": "8.46.3",
7
+ "@typescript-eslint/eslint-plugin": "8.46.4",
8
+ "@typescript-eslint/parser": "8.46.4",
9
9
  "@vitest/eslint-plugin": "1.4.2",
10
10
  "eslint-config-prettier": "10.1.8",
11
11
  "eslint-import-resolver-typescript": "4.4.4",
12
12
  "eslint-plugin-import": "2.32.0",
13
- "eslint-plugin-jest": "29.0.1",
13
+ "eslint-plugin-jest": "29.1.0",
14
14
  "eslint-plugin-json": "4.0.1",
15
15
  "eslint-plugin-n": "17.23.1",
16
16
  "eslint-plugin-perfectionist": "4.15.1",
17
17
  "eslint-plugin-prettier": "5.5.4",
18
18
  "eslint-plugin-sonarjs": "3.0.5",
19
19
  "eslint-plugin-unicorn": "56.0.1",
20
- "typescript-eslint": "8.46.3"
20
+ "typescript-eslint": "8.46.4"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@prettier/plugin-oxc": "0.0.4",
@@ -56,6 +56,6 @@
56
56
  "access": "public"
57
57
  },
58
58
  "repository": "https://github.com/open-turo/eslint-config-typescript",
59
- "version": "18.1.13",
59
+ "version": "18.1.14-pr-461.404.1.1",
60
60
  "packageManager": "npm@11.6.2"
61
61
  }
package/test/test.spec.js CHANGED
@@ -1,5 +1,8 @@
1
+ /** @import { ParserOptions } from "@typescript-eslint/parser"; */
1
2
  import { loadESLint } from "eslint";
2
3
 
4
+ import recommendedConfig from "../recommended.cjs";
5
+
3
6
  describe("validate config", () => {
4
7
  const testFileName = "test.js";
5
8
  const code = `const foo = 1;\nconsole.log(foo);\n`;
@@ -13,11 +16,23 @@ describe("validate config", () => {
13
16
  const ESLint = await loadESLint({
14
17
  useFlatConfig: false,
15
18
  });
19
+ const modifiedRecommendedConfig = {
20
+ ...recommendedConfig,
21
+ parserOptions: {
22
+ ...recommendedConfig.parserOptions,
23
+ /**
24
+ * @typescript-eslint/parser@8.46.4 errors if `projectService` and `project` are both defined.
25
+ * `@typescript-eslint` recommends `projectService` over `project`, and we use `projectService` in the non-legacy config,
26
+ * but not the legacy `recommended` config. Because thi spec uses `projectService`, we explicitly omit `project` here to avoid the error.
27
+ */
28
+ project: undefined,
29
+ },
30
+ };
16
31
  const linter = new ESLint({
32
+ baseConfig: modifiedRecommendedConfig,
17
33
  overrideConfig: {
18
34
  parserOptions,
19
35
  },
20
- overrideConfigFile: "./recommended.cjs",
21
36
  });
22
37
  const messages = await linter.lintText(code, {
23
38
  filePath: testFileName,