mirror of https://github.com/iptv-org/iptv
Update eslint.config.mjs
parent
dca2c7dc4c
commit
bf643cbd87
@ -1,46 +1,50 @@
|
|||||||
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 [
|
export default [
|
||||||
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
|
...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended'),
|
||||||
{
|
{
|
||||||
plugins: {
|
plugins: {
|
||||||
"@typescript-eslint": typescriptEslint,
|
'@typescript-eslint': typescriptEslint
|
||||||
},
|
},
|
||||||
|
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
...globals.browser,
|
...globals.browser
|
||||||
},
|
},
|
||||||
|
|
||||||
parser: tsParser,
|
parser: tsParser,
|
||||||
ecmaVersion: "latest",
|
ecmaVersion: 'latest',
|
||||||
sourceType: "module",
|
sourceType: 'module'
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
"no-case-declarations": "off",
|
'no-case-declarations': 'off',
|
||||||
|
|
||||||
indent: ["error", 2, {
|
indent: [
|
||||||
SwitchCase: 1,
|
'error',
|
||||||
}],
|
2,
|
||||||
|
{
|
||||||
|
SwitchCase: 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
"linebreak-style": ["error", "unix"],
|
'linebreak-style': ['error', 'windows'],
|
||||||
quotes: ["error", "single"],
|
quotes: ['error', 'single'],
|
||||||
semi: ["error", "never"],
|
semi: ['error', 'never']
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
];
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue