forked from web-infra-dev/rspack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
36 lines (33 loc) · 900 Bytes
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { readFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import tsParser from "@typescript-eslint/parser";
import oxlint from "eslint-plugin-oxlint";
import simpleImportSort from "eslint-plugin-simple-import-sort";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const ignores = readFileSync(path.resolve(__dirname, ".eslintignore"), "utf-8")
.split(/\r?\n/)
.filter(item => {
return !item.startsWith("#") && !item.startsWith("//") && item.trim();
});
export default [
{
files: ["**/*.ts", "**/*.mts", "**/*.cts"],
languageOptions: {
parser: tsParser
}
},
{
plugins: {
"simple-import-sort": simpleImportSort
},
rules: {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
}
},
oxlint.configs["flat/recommended"], // oxlint should be the last one
{
ignores
}
];