Fixed eslint.config.mjs fomartting
parent
7d6556d549
commit
82c72f3a5c
@ -1,61 +1,67 @@
|
|||||||
import { defineConfig, globalIgnores } from "eslint/config";
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||||
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
||||||
import globals from "globals";
|
import globals from 'globals'
|
||||||
import tsParser from "@typescript-eslint/parser";
|
import tsParser from '@typescript-eslint/parser'
|
||||||
import path from "node:path";
|
import path from 'node:path'
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from 'node:url'
|
||||||
import js from "@eslint/js";
|
import js from '@eslint/js'
|
||||||
import { FlatCompat } from "@eslint/eslintrc";
|
import { FlatCompat } from '@eslint/eslintrc'
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename)
|
||||||
const compat = new FlatCompat({
|
const compat = new FlatCompat({
|
||||||
baseDirectory: __dirname,
|
baseDirectory: __dirname,
|
||||||
recommendedConfig: js.configs.recommended,
|
recommendedConfig: js.configs.recommended,
|
||||||
allConfig: js.configs.all
|
allConfig: js.configs.all,
|
||||||
});
|
})
|
||||||
|
|
||||||
export default defineConfig([
|
export default defineConfig([
|
||||||
globalIgnores(["**/dist", "**/node_modules", "**/*.config.js", "**/*.config.ts"]),
|
globalIgnores(['**/dist', '**/node_modules', '**/*.config.js', '**/*.config.ts']),
|
||||||
{
|
{
|
||||||
extends: compat.extends(
|
extends: compat.extends(
|
||||||
"eslint:recommended",
|
'eslint:recommended',
|
||||||
"plugin:@typescript-eslint/recommended",
|
'plugin:@typescript-eslint/recommended',
|
||||||
"plugin:solid/recommended",
|
'plugin:solid/recommended',
|
||||||
"prettier",
|
'prettier'
|
||||||
),
|
),
|
||||||
|
|
||||||
plugins: {
|
|
||||||
"@typescript-eslint": typescriptEslint,
|
|
||||||
},
|
|
||||||
|
|
||||||
languageOptions: {
|
plugins: {
|
||||||
globals: {
|
'@typescript-eslint': typescriptEslint,
|
||||||
...globals.browser,
|
},
|
||||||
...globals.node,
|
|
||||||
},
|
|
||||||
|
|
||||||
parser: tsParser,
|
languageOptions: {
|
||||||
ecmaVersion: "latest",
|
globals: {
|
||||||
sourceType: "module",
|
...globals.browser,
|
||||||
},
|
...globals.node,
|
||||||
|
},
|
||||||
|
|
||||||
rules: {
|
parser: tsParser,
|
||||||
"@typescript-eslint/explicit-function-return-type": "warn",
|
ecmaVersion: 'latest',
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/explicit-function-return-type': 'warn',
|
||||||
|
|
||||||
"@typescript-eslint/no-unused-vars": ["error", {
|
'@typescript-eslint/no-unused-vars': [
|
||||||
argsIgnorePattern: "^_",
|
'error',
|
||||||
}],
|
{
|
||||||
|
argsIgnorePattern: '^_',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
"@typescript-eslint/no-explicit-any": "warn",
|
'@typescript-eslint/no-explicit-any': 'warn',
|
||||||
"prefer-const": "error",
|
'prefer-const': 'error',
|
||||||
"no-var": "error",
|
'no-var': 'error',
|
||||||
"object-shorthand": "error",
|
'object-shorthand': 'error',
|
||||||
"prefer-template": "error",
|
'prefer-template': 'error',
|
||||||
|
|
||||||
"no-console": ["warn", {
|
'no-console': [
|
||||||
allow: ["warn", "error"],
|
'warn',
|
||||||
}],
|
{
|
||||||
|
allow: ['warn', 'error'],
|
||||||
},
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]);
|
},
|
||||||
|
])
|
||||||
|
|||||||
Loading…
Reference in New Issue