Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion packages/web-features/index.ts
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/web-features/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ES2016",
"module": "ESNext",
"moduleResolution": "Bundler",
"module": "nodenext",
"moduleResolution": "nodenext",
"typeRoots": ["./node_modules/@types"],
"declaration": true
}
Expand Down
2 changes: 1 addition & 1 deletion types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
Release,
SnapshotData,
Support,
} from "./types.quicktype";
} from "./types.quicktype.js";

// Passthrough types
export type {
Expand Down