Skip to content

Commit

Permalink
Add new ESLint configuration and fix lint issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaoliao committed Dec 28, 2024
1 parent af322a6 commit c51305b
Show file tree
Hide file tree
Showing 38 changed files with 1,241 additions and 1,271 deletions.
59 changes: 59 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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";


const EslintConfig = [
{
ignores: [
"dist/",
"node_modules/",
],
},
CommonConfig,
...TsConfigArray.map(
(config) => ({
files: [
"**/*.ts",
"**/*.tsx",
],
...config,
})
),
...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: ["test/**/*"],
...JestConfig,
},
];


export default EslintConfig;
Loading

0 comments on commit c51305b

Please sign in to comment.