Skip to content

Commit 1e013b7

Browse files
committed
Add eslint to game-template
1 parent 1f2cb3c commit 1e013b7

File tree

4 files changed

+77
-2
lines changed

4 files changed

+77
-2
lines changed

game-template/game/.eslintrc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint", "simple-import-sort"],
5+
"rules": {
6+
"@typescript-eslint/no-explicit-any": "off",
7+
"@typescript-eslint/no-unused-vars": "warn",
8+
"simple-import-sort/imports": [
9+
"error",
10+
{
11+
"groups": [
12+
["^\\u0000"],
13+
["^node:"],
14+
["^@?\\w"],
15+
["^@lefun/"],
16+
["^"],
17+
["^\\."]
18+
]
19+
}
20+
],
21+
"simple-import-sort/exports": "error"
22+
},
23+
"extends": [
24+
"eslint:recommended",
25+
"plugin:@typescript-eslint/eslint-recommended",
26+
"plugin:@typescript-eslint/recommended"
27+
],
28+
"ignorePatterns": ["dist/**/*"]
29+
}

game-template/game/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"types": "dist/index.d.ts",
1111
"scripts": {
1212
"build": "rm -rf ./dist && pnpm rollup --config",
13-
"watch": "pnpm rollup --config --watch"
13+
"watch": "pnpm rollup --config --watch",
14+
"format": "pnpm eslint . --fix",
15+
"check-format": "pnpm eslint . --quiet"
1416
},
1517
"devDependencies": {
1618
"@lefun/core": "workspace:*",

game-template/ui/.eslintrc.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"extends": [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"prettier"
8+
],
9+
"plugins": ["@typescript-eslint", "react-hooks", "simple-import-sort"],
10+
"rules": {
11+
"react-hooks/rules-of-hooks": "error",
12+
"react-hooks/exhaustive-deps": "warn",
13+
"simple-import-sort/imports": [
14+
"error",
15+
{
16+
"groups": [
17+
["^\\u0000"],
18+
["^node:"],
19+
["^@?\\w"],
20+
["^@lefun/"],
21+
["^roll-game$"],
22+
["^"],
23+
["^\\."]
24+
]
25+
}
26+
],
27+
"simple-import-sort/exports": "error"
28+
},
29+
"parserOptions": {
30+
"sourceType": "module",
31+
"ecmaVersion": 2015
32+
},
33+
"overrides": [
34+
{
35+
"files": ["*.jsx", "*.tsx"],
36+
"rules": {
37+
"@typescript-eslint/explicit-module-boundary-types": ["off"]
38+
}
39+
}
40+
],
41+
"ignorePatterns": ["dist/**/*"]
42+
}

game-template/ui/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"build": "rm -rf ./dist && pnpm rollup --config",
1313
"dev": "pnpm vite --host",
1414
"lingui:compile": "pnpm lingui compile",
15-
"lingui:extract": "pnpm lingui extract"
15+
"lingui:extract": "pnpm lingui extract",
16+
"format": "pnpm eslint . --fix",
17+
"check-format": "pnpm eslint . --quiet"
1618
},
1719
"devDependencies": {
1820
"@babel/preset-react": "^7.24.7",

0 commit comments

Comments
 (0)