81 lines
2.6 KiB
JavaScript
81 lines
2.6 KiB
JavaScript
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
import typescriptParser from '@typescript-eslint/parser';
|
|
|
|
export default [
|
|
{
|
|
files: ["**/*.js"],
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: "commonjs",
|
|
globals: {
|
|
console: "readonly",
|
|
process: "readonly",
|
|
Buffer: "readonly",
|
|
__dirname: "readonly",
|
|
__filename: "readonly",
|
|
module: "readonly",
|
|
require: "readonly",
|
|
exports: "readonly",
|
|
global: "readonly",
|
|
setTimeout: "readonly",
|
|
clearTimeout: "readonly",
|
|
setInterval: "readonly",
|
|
clearInterval: "readonly",
|
|
URLSearchParams: "readonly",
|
|
window: "readonly",
|
|
document: "readonly",
|
|
fetch: "readonly",
|
|
event: "readonly"
|
|
}
|
|
},
|
|
rules: {
|
|
"indent": ["error", 4],
|
|
"quotes": ["error", "single"],
|
|
"semi": ["error", "always"],
|
|
"no-unused-vars": "warn",
|
|
"no-console": "off",
|
|
"no-undef": "error"
|
|
}
|
|
},
|
|
{
|
|
files: ["**/*.ts"],
|
|
languageOptions: {
|
|
parser: typescriptParser,
|
|
parserOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: "module",
|
|
project: ["./tsconfig.json", "./tsconfig.frontend.json"]
|
|
},
|
|
globals: {
|
|
console: "readonly",
|
|
process: "readonly",
|
|
Buffer: "readonly",
|
|
__dirname: "readonly",
|
|
__filename: "readonly",
|
|
module: "readonly",
|
|
require: "readonly",
|
|
exports: "readonly",
|
|
global: "readonly",
|
|
setTimeout: "readonly",
|
|
clearTimeout: "readonly",
|
|
setInterval: "readonly",
|
|
clearInterval: "readonly",
|
|
URLSearchParams: "readonly",
|
|
window: "readonly",
|
|
document: "readonly",
|
|
fetch: "readonly",
|
|
event: "readonly"
|
|
}
|
|
},
|
|
plugins: {
|
|
"@typescript-eslint": typescriptEslint
|
|
},
|
|
rules: {
|
|
"indent": ["error", 4],
|
|
"quotes": ["error", "single"],
|
|
"semi": ["error", "always"],
|
|
"@typescript-eslint/no-unused-vars": "warn",
|
|
"no-console": "off"
|
|
}
|
|
}
|
|
]; |