diff --git a/eslint.config.js b/eslint.config.js index 62c7785e02d..bbda4075eb5 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,21 +1,26 @@ import newWithError from "eslint-plugin-new-with-error"; +import { defineConfig, globalIgnores } from "eslint/config"; import tseslint from "typescript-eslint"; -export default tseslint.config(tseslint.configs.base, { - plugins: { newWithError }, - rules: { - "@typescript-eslint/no-unused-vars": [ - "error", - { - caughtErrors: "none", - }, - ], - "newWithError/new-with-error": "error", - "no-duplicate-imports": "error", - "no-throw-literal": "error", +export default defineConfig( + tseslint.configs.base, + { + plugins: { newWithError }, + rules: { + "@typescript-eslint/no-unused-vars": [ + "error", + { + caughtErrors: "none", + }, + ], + "newWithError/new-with-error": "error", + "no-duplicate-imports": "error", + "no-throw-literal": "error", + }, + files: ["**/*.ts"], }, - files: ["**/*.ts"], -}); + globalIgnores(["packages/web-features/**/*.js"]), +); // TODO: do linting more comprehensively, something like: // import eslint from "@eslint/js"; diff --git a/packages/web-features/index.ts b/packages/web-features/index.ts index 54ae8ee16c0..8196ca6ceba 100644 --- a/packages/web-features/index.ts +++ b/packages/web-features/index.ts @@ -1,7 +1,7 @@ import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; -import { WebFeaturesData } from "./types"; +import { WebFeaturesData } from "./types.js"; const jsonPath = fileURLToPath(new URL("./data.json", import.meta.url)); const { browsers, features, groups, snapshots } = JSON.parse( diff --git a/packages/web-features/tsconfig.json b/packages/web-features/tsconfig.json index e483fa95943..2fce7bb7a0f 100644 --- a/packages/web-features/tsconfig.json +++ b/packages/web-features/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "ES2016", - "module": "ESNext", - "moduleResolution": "Bundler", + "module": "nodenext", + "moduleResolution": "nodenext", "typeRoots": ["./node_modules/@types"], "declaration": true } diff --git a/types.ts b/types.ts index 24256c80498..14d44ef4e0f 100644 --- a/types.ts +++ b/types.ts @@ -18,7 +18,7 @@ import type { Release, SnapshotData, Support, -} from "./types.quicktype"; +} from "./types.quicktype.js"; // Passthrough types export type {