|
|
|
|
@ -1,32 +1,32 @@
|
|
|
|
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
|
|
|
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);
|
|
|
|
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
|
|
|
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
|
|
|
|
|
});
|
|
|
|
|
allConfig: js.configs.all,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export default defineConfig([
|
|
|
|
|
globalIgnores(["**/dist", "**/node_modules", "**/*.config.js", "**/*.config.ts"]),
|
|
|
|
|
globalIgnores(['**/dist', '**/node_modules', '**/*.config.js', '**/*.config.ts']),
|
|
|
|
|
{
|
|
|
|
|
extends: compat.extends(
|
|
|
|
|
"eslint:recommended",
|
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
|
"plugin:solid/recommended",
|
|
|
|
|
"prettier",
|
|
|
|
|
'eslint:recommended',
|
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
|
'plugin:solid/recommended',
|
|
|
|
|
'prettier'
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
plugins: {
|
|
|
|
|
"@typescript-eslint": typescriptEslint,
|
|
|
|
|
'@typescript-eslint': typescriptEslint,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
languageOptions: {
|
|
|
|
|
@ -36,26 +36,32 @@ export default defineConfig([
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
parser: tsParser,
|
|
|
|
|
ecmaVersion: "latest",
|
|
|
|
|
sourceType: "module",
|
|
|
|
|
ecmaVersion: 'latest',
|
|
|
|
|
sourceType: 'module',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
"@typescript-eslint/explicit-function-return-type": "warn",
|
|
|
|
|
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
|
|
|
|
|
|
|
|
"@typescript-eslint/no-unused-vars": ["error", {
|
|
|
|
|
argsIgnorePattern: "^_",
|
|
|
|
|
}],
|
|
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
|
'error',
|
|
|
|
|
{
|
|
|
|
|
argsIgnorePattern: '^_',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
|
|
|
"prefer-const": "error",
|
|
|
|
|
"no-var": "error",
|
|
|
|
|
"object-shorthand": "error",
|
|
|
|
|
"prefer-template": "error",
|
|
|
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
|
|
|
'prefer-const': 'error',
|
|
|
|
|
'no-var': 'error',
|
|
|
|
|
'object-shorthand': 'error',
|
|
|
|
|
'prefer-template': 'error',
|
|
|
|
|
|
|
|
|
|
"no-console": ["warn", {
|
|
|
|
|
allow: ["warn", "error"],
|
|
|
|
|
}],
|
|
|
|
|
'no-console': [
|
|
|
|
|
'warn',
|
|
|
|
|
{
|
|
|
|
|
allow: ['warn', 'error'],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
])
|
|
|
|
|
|