Skip to content

Commit 21a5f98

Browse files
authored
Merge pull request #135 from Project-Chirp/T98-Configure-ESLint
T98: Configure ESLint
2 parents f13bc15 + 33bd931 commit 21a5f98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4058
-796
lines changed

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"endOfLine": "auto"
3+
}

.vscode/settings.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"editor.formatOnSave": true
3-
}
2+
"editor.formatOnSave": true,
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll.eslint": "explicit"
5+
}
6+
}

eslint.config.mjs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* eslint-disable import-x/no-named-as-default-member */
2+
import pluginJs from "@eslint/js";
3+
import tsParser from "@typescript-eslint/parser";
4+
import eslintPluginImportX from "eslint-plugin-import-x";
5+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
6+
import pluginReact from "eslint-plugin-react";
7+
import globals from "globals";
8+
import tseslint from "typescript-eslint";
9+
10+
export default [
11+
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
12+
{ languageOptions: { globals: globals.browser } },
13+
pluginJs.configs.recommended,
14+
...tseslint.configs.recommended,
15+
pluginReact.configs.flat.recommended,
16+
pluginReact.configs.flat["jsx-runtime"],
17+
eslintPluginImportX.flatConfigs.recommended,
18+
eslintPluginImportX.flatConfigs.typescript,
19+
eslintPluginPrettierRecommended,
20+
{ ignores: ["build/"] },
21+
{
22+
languageOptions: {
23+
parser: tsParser,
24+
ecmaVersion: "latest",
25+
sourceType: "module",
26+
},
27+
rules: {
28+
"@typescript-eslint/no-explicit-any": "off",
29+
"import-x/default": "off",
30+
"import-x/order": [
31+
"error",
32+
{
33+
alphabetize: {
34+
order: "asc",
35+
caseInsensitive: true,
36+
},
37+
},
38+
],
39+
"react/jsx-sort-props": ["error", { ignoreCase: true }],
40+
"react/sort-prop-types": "error",
41+
},
42+
settings: {
43+
react: {
44+
version: "detect",
45+
},
46+
},
47+
},
48+
];

0 commit comments

Comments
 (0)