Skip to content

Commit

Permalink
chore(lint): Migrate to ESLint V9. (#161)
Browse files Browse the repository at this point in the history
- Upgrade eslint-config-yscope to v1.1.0 and fix lint issues.
  • Loading branch information
junhaoliao authored Jan 22, 2025
1 parent a8b8da7 commit 3edb817
Show file tree
Hide file tree
Showing 40 changed files with 1,746 additions and 1,166 deletions.
60 changes: 60 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import CommonConfig from "eslint-config-yscope/CommonConfig.mjs";
import JestConfig from "eslint-config-yscope/JestConfig.mjs";
import ReactConfigArray from "eslint-config-yscope/ReactConfigArray.mjs";
import StylisticConfigArray from "eslint-config-yscope/StylisticConfigArray.mjs";
import TsConfigArray from "eslint-config-yscope/TsConfigArray.mjs";
import Globals from "globals";


const EslintConfig = [
{
ignores: [
"dist/",
"node_modules/",
],
},
CommonConfig,
...TsConfigArray,
...StylisticConfigArray,
...ReactConfigArray,
{
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
message: "Please use path imports and name your imports with postfix " +
"\"Icon\" to avoid confusions.",
name: "@mui/icons-material",
},
],
patterns: [
{
group: [
"@mui/joy/*",
"!@mui/joy/styles",
],
message: "Please use the default import from \"@mui/joy\" instead.",
},
],
},
],
},
},
{
files: ["webpack.*.js"],
languageOptions: {
globals: {
...Globals.node,
},
},
},
{
files: ["test/**/*"],
...JestConfig,
},
];


export default EslintConfig;
3 changes: 2 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type {Config} from "jest";
import os from "node:os";
import pathPosix from "node:path/posix";

import type {Config} from "jest";


let PRIMARY_REPORTER: string | [string, Record<string, unknown>] = "default";
if ("undefined" !== typeof process.env.GITHUB_ACTIONS) {
Expand Down
Loading

0 comments on commit 3edb817

Please sign in to comment.