Skip to content

Commit

Permalink
chore: update Node.js version to 22 in workflows and simplify ESLint …
Browse files Browse the repository at this point in the history
…configuration

Signed-off-by: walnuts1018 <[email protected]>
  • Loading branch information
walnuts1018 committed Jan 24, 2025
1 parent 24357dc commit 8393ec5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: setup-node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: install
run: yarn install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: "20"
node-version: 22
- run: yarn install

- name: eslint
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
- name: setup-node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: install
run: yarn install
Expand Down
63 changes: 8 additions & 55 deletions eslint.config.mjs
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;

0 comments on commit 8393ec5

Please sign in to comment.