|
Line 0
Link Here
|
| 0 |
- |
1 |
import prettier from "eslint-plugin-prettier"; |
|
|
2 |
import globals from "globals"; |
| 3 |
import path from "node:path"; |
| 4 |
import { fileURLToPath } from "node:url"; |
| 5 |
import js from "@eslint/js"; |
| 6 |
import { FlatCompat } from "@eslint/eslintrc"; |
| 7 |
|
| 8 |
const __filename = fileURLToPath(import.meta.url); |
| 9 |
const __dirname = path.dirname(__filename); |
| 10 |
const compat = new FlatCompat({ |
| 11 |
baseDirectory: __dirname, |
| 12 |
recommendedConfig: js.configs.recommended, |
| 13 |
allConfig: js.configs.all |
| 14 |
}); |
| 15 |
|
| 16 |
export default [...compat.extends("eslint:recommended", "eslint-config-prettier"), { |
| 17 |
plugins: { |
| 18 |
prettier, |
| 19 |
}, |
| 20 |
|
| 21 |
languageOptions: { |
| 22 |
globals: { |
| 23 |
...globals.browser, |
| 24 |
...globals.jquery, |
| 25 |
}, |
| 26 |
}, |
| 27 |
|
| 28 |
rules: { |
| 29 |
indent: ["error", 4], |
| 30 |
"linebreak-style": ["error", "unix"], |
| 31 |
semi: ["error", "always"], |
| 32 |
"prettier/prettier": ["error"], |
| 33 |
}, |
| 34 |
}]; |