-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update Node.js version to 22 in workflows and simplify ESLint …
…configuration Signed-off-by: walnuts1018 <[email protected]>
- Loading branch information
1 parent
24357dc
commit 8393ec5
Showing
3 changed files
with
11 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,16 @@ | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { fixupConfigRules } from "@eslint/compat"; | ||
import { dirname } from "path"; | ||
import { fileURLToPath } from "url"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
import js from "@eslint/js"; | ||
import perfectionistPlugin from "eslint-plugin-perfectionist"; | ||
import tseslint from "typescript-eslint"; | ||
import unusedImportsPlugin from "eslint-plugin-unused-imports"; | ||
import globals from "globals"; | ||
import nextPlugin from "@next/eslint-plugin-next"; | ||
import { configs } from "typescript-eslint"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const __dirname = dirname(__filename); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all, | ||
}); | ||
|
||
const config = tseslint.config( | ||
{ | ||
languageOptions: { | ||
globals: globals.browser, | ||
}, | ||
}, | ||
js.configs.recommended, | ||
nextPlugin.configs.recommended, | ||
...configs.strict, | ||
...fixupConfigRules( | ||
compat.extends( | ||
"next", | ||
"next/core-web-vitals", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript" | ||
) | ||
), | ||
{ | ||
plugins: { "unused-imports": unusedImportsPlugin }, | ||
rules: { | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"unused-imports/no-unused-imports": "error", | ||
"unused-imports/no-unused-vars": [ | ||
"error", | ||
{ | ||
vars: "all", | ||
varsIgnorePattern: "^_", | ||
args: "after-used", | ||
argsIgnorePattern: "^_", | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
plugins: { perfectionist: perfectionistPlugin }, | ||
rules: { | ||
"perfectionist/sort-interfaces": "warn", | ||
"perfectionist/sort-object-types": "warn", | ||
}, | ||
} | ||
); | ||
const eslintConfig = [ | ||
...compat.extends("next/core-web-vitals", "next/typescript"), | ||
]; | ||
|
||
export default config; | ||
export default eslintConfig; |