-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update packages, and migrate eslint configuration
This updates the eslint configuration to the new flat file format, which is the future format. Also adds eslint as a dev dependency. JS Projects should have locally installed the correct versions of development tools like eslint/prettier, etc. So developer experience is consistent; and not depending on external context, like globally installed versions; but the version that matches the configuration. Also updates outdated packages, like typescript Would have liked to update to eslint@9, but the typescript module does not yet support 9 as a peer dependency.
- Loading branch information
Showing
5 changed files
with
2,234 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import globals from "globals"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [{ | ||
ignores: ["**/node_modules/", "**/main.js"], | ||
}, ...compat.extends( | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
), { | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
|
||
parser: tsParser, | ||
ecmaVersion: 5, | ||
sourceType: "module", | ||
}, | ||
|
||
rules: { | ||
"no-unused-vars": "off", | ||
|
||
"@typescript-eslint/no-unused-vars": ["error", { | ||
args: "none", | ||
}], | ||
|
||
"@typescript-eslint/ban-ts-comment": "off", | ||
"no-prototype-builtins": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
}, | ||
}]; |
Oops, something went wrong.