From 832bcd840875392b39a52d271f5f851ab6dc018a Mon Sep 17 00:00:00 2001 From: Kaciras Date: Sat, 13 Apr 2024 09:28:05 +0800 Subject: [PATCH] switch to ESLint flat config --- .eslintignore | 3 --- .eslintrc.cjs | 18 ------------------ eslint.config.js | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 21 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 0f05bbc..0000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/deps -/dist -lib/**/*.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 00de81b..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - root: true, - extends: [ - "@kaciras/core", - "@kaciras/typescript", - "@kaciras/react", - ], - env: { - node: true, - }, - rules: { - "react-hooks/exhaustive-deps": "off", - }, - overrides: [{ - files: "**/test/*.spec.[jt]s?(x)", - extends: ["@kaciras/jest"], - }], -}; diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..4681acc --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,17 @@ +import core from "@kaciras/eslint-config-core"; +import typescript from "@kaciras/eslint-config-typescript"; +import jest from "@kaciras/eslint-config-jest"; +import react from "@kaciras/eslint-config-react"; + +export default [ + { ignores: ["deps/**", "dist/**", "lib/**/*.js"] }, + ...core, + ...typescript, + ...react, + { + rules: { + "react-hooks/exhaustive-deps": "off", + }, + }, + ...jest.map(c => ({ ...c, files: ["test/*.spec.ts"]})), +];