Skip to content

Commit

Permalink
Merge pull request #35 from uay13211/master
Browse files Browse the repository at this point in the history
upgrade eslint v9
  • Loading branch information
dionshihk authored Aug 29, 2024
2 parents 0d39462 + b19db8d commit 6df78e6
Show file tree
Hide file tree
Showing 7 changed files with 261 additions and 291 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

61 changes: 0 additions & 61 deletions config/.eslintrc.json

This file was deleted.

83 changes: 83 additions & 0 deletions config/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// @ts-check
const eslintConfigPrettier = require("eslint-config-prettier");
const eslint = require("@eslint/js");
const tsESlint = require("typescript-eslint");

module.exports = tsESlint.config(
{
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
plugins: {
"@typescript-eslint": tsESlint.plugin,
},
extends: [eslint.configs.recommended, ...tsESlint.configs.recommended, tsESlint.configs.eslintRecommended, eslintConfigPrettier],
languageOptions: {
parser: tsESlint.parser,
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {jsx: true},
},
},
rules: {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": ["error", {accessibility: "no-public"}],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/member-ordering": [
"error",
{
default: {
memberTypes: [
"public-static-field",
"protected-static-field",
"private-static-field",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"public-abstract-field",
"protected-abstract-field",
"public-constructor",
"protected-constructor",
"private-constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method",
"public-abstract-method",
"protected-abstract-method",
],
order: "as-written",
},
},
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": ["error", "nofunc"],
"@typescript-eslint/ban-ts-comment": "off",
"no-console": ["error", {allow: ["info", "warn", "error"]}],
"no-duplicate-imports": ["error"],
"no-useless-computed-key": ["error"],
"no-useless-rename": ["error"],
"no-var": ["error"],
"object-shorthand": "error",
"prefer-const": ["error"],
"require-yield": "off",
},
},
{
files: ["**/*.config.js", "**/*.config.jsx", "**/*.config.ts", "**/*.config.tsx", "**/script/*.js"],
rules: {
"@typescript-eslint/no-require-imports": "off",
},
},
{
ignores: ["**/build/**/*", "**/dist/**/*", "**/node_modules/**/*"],
}
);
4 changes: 4 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @ts-check
const baseConfig = require("./config/eslint.config");

module.exports = baseConfig;
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
"@testing-library/user-event": "14.5.2",
"@types/jest": "29.5.12",
"@types/node": "22.5.1",
"@typescript-eslint/eslint-plugin": "7.3.1",
"@typescript-eslint/parser": "7.3.1",
"eslint": "8.57.0",
"typescript-eslint": "8.3.0",
"eslint": "9.9.1",
"eslint-config-prettier": "9.1.0",
"fs-extra": "11.2.0",
"jest": "29.7.0",
Expand Down
Loading

0 comments on commit 6df78e6

Please sign in to comment.