Configure eslint
This commit is contained in:
parent
2030d095c9
commit
26bba4e2ff
3 changed files with 68 additions and 60 deletions
|
|
@ -1,46 +1,32 @@
|
||||||
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
import eslint from "@eslint/js";
|
||||||
import globals from "globals";
|
import tseslint from "typescript-eslint";
|
||||||
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";
|
|
||||||
import unusedImports from "eslint-plugin-unused-imports";
|
import unusedImports from "eslint-plugin-unused-imports";
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
export default tseslint.config({
|
||||||
const __dirname = path.dirname(__filename);
|
|
||||||
const compat = new FlatCompat({
|
|
||||||
baseDirectory: __dirname,
|
|
||||||
recommendedConfig: js.configs.recommended,
|
|
||||||
allConfig: js.configs.all,
|
|
||||||
});
|
|
||||||
|
|
||||||
export default [
|
|
||||||
...compat.extends(
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended"
|
|
||||||
),
|
|
||||||
{
|
|
||||||
plugins: {
|
plugins: {
|
||||||
"@typescript-eslint": typescriptEslint,
|
|
||||||
"unused-imports": unusedImports,
|
"unused-imports": unusedImports,
|
||||||
},
|
},
|
||||||
|
extends: [eslint.configs.recommended, tseslint.configs.all],
|
||||||
languageOptions: {
|
ignores: ["**/types.ts"],
|
||||||
globals: {
|
|
||||||
...globals.node,
|
|
||||||
},
|
|
||||||
|
|
||||||
parser: tsParser,
|
|
||||||
ecmaVersion: 5,
|
|
||||||
sourceType: "module",
|
|
||||||
},
|
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"@typescript-eslint/no-unused-vars": "off",
|
"@typescript-eslint/no-unused-vars": "off",
|
||||||
|
"@typescript-eslint/no-floating-promises": "error",
|
||||||
|
"@typescript-eslint/parameter-properties": "off",
|
||||||
|
"@typescript-eslint/require-await": "off",
|
||||||
|
"@typescript-eslint/class-methods-use-this": "off",
|
||||||
|
"@typescript-eslint/consistent-return": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-argument": "off",
|
||||||
|
"@typescript-eslint/max-params": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
max: 5,
|
||||||
|
},
|
||||||
|
],
|
||||||
"unused-imports/no-unused-imports": "error",
|
"unused-imports/no-unused-imports": "error",
|
||||||
|
"@typescript-eslint/no-magic-numbers": "off",
|
||||||
|
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
||||||
|
"@typescript-eslint/naming-convention": "off",
|
||||||
"unused-imports/no-unused-vars": [
|
"unused-imports/no-unused-vars": [
|
||||||
"warn",
|
"warn",
|
||||||
{
|
{
|
||||||
|
|
@ -50,10 +36,11 @@ export default [
|
||||||
argsIgnorePattern: "^_",
|
argsIgnorePattern: "^_",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
},
|
||||||
"@typescript-eslint/ban-ts-comment": "off",
|
languageOptions: {
|
||||||
"no-prototype-builtins": "off",
|
parserOptions: {
|
||||||
"@typescript-eslint/no-empty-function": "off",
|
projectService: true,
|
||||||
|
tsconfigRootDir: import.meta.dirname,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
});
|
||||||
|
|
|
||||||
28
plugin/package-lock.json
generated
28
plugin/package-lock.json
generated
|
|
@ -10,8 +10,6 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.11.6",
|
"@types/node": "^16.11.6",
|
||||||
"@typescript-eslint/eslint-plugin": "8.18.0",
|
|
||||||
"@typescript-eslint/parser": "8.18.0",
|
|
||||||
"builtin-modules": "3.3.0",
|
"builtin-modules": "3.3.0",
|
||||||
"esbuild": "0.24.0",
|
"esbuild": "0.24.0",
|
||||||
"esbuild-plugin-wasm-pack": "^1.1.0",
|
"esbuild-plugin-wasm-pack": "^1.1.0",
|
||||||
|
|
@ -22,7 +20,8 @@
|
||||||
"openapi-typescript": "7.4.4",
|
"openapi-typescript": "7.4.4",
|
||||||
"p-queue": "^8.0.1",
|
"p-queue": "^8.0.1",
|
||||||
"tslib": "2.4.0",
|
"tslib": "2.4.0",
|
||||||
"typescript": "5.7.2"
|
"typescript": "5.7.2",
|
||||||
|
"typescript-eslint": "8.18.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/code-frame": {
|
"node_modules/@babel/code-frame": {
|
||||||
|
|
@ -2483,6 +2482,29 @@
|
||||||
"node": ">=14.17"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/typescript-eslint": {
|
||||||
|
"version": "8.18.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.0.tgz",
|
||||||
|
"integrity": "sha512-Xq2rRjn6tzVpAyHr3+nmSg1/9k9aIHnJ2iZeOH7cfGOWqTkXTm3kwpQglEuLGdNrYvPF+2gtAs+/KF5rjVo+WQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@typescript-eslint/eslint-plugin": "8.18.0",
|
||||||
|
"@typescript-eslint/parser": "8.18.0",
|
||||||
|
"@typescript-eslint/utils": "8.18.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"eslint": "^8.57.0 || ^9.0.0",
|
||||||
|
"typescript": ">=4.8.4 <5.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/uri-js": {
|
"node_modules/uri-js": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.11.6",
|
"@types/node": "^16.11.6",
|
||||||
"@typescript-eslint/eslint-plugin": "8.18.0",
|
"typescript-eslint": "8.18.0",
|
||||||
"@typescript-eslint/parser": "8.18.0",
|
|
||||||
"builtin-modules": "3.3.0",
|
"builtin-modules": "3.3.0",
|
||||||
"esbuild": "0.24.0",
|
"esbuild": "0.24.0",
|
||||||
"esbuild-plugin-wasm-pack": "^1.1.0",
|
"esbuild-plugin-wasm-pack": "^1.1.0",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue