update eslint to omit blank line between members

This commit is contained in:
wancat committed 2024-02-06 09:31:20 +08:00
1 parent e91774fe3b
commit 2a542302bc
5 files changed
+21 -5

No files matched your search

+13
View File
@@ -40,6 +40,11 @@ module.exports = {
'prettier/prettier': ['error', { endOfLine: 'auto', semi: false }], 'prettier/prettier': ['error', { endOfLine: 'auto', semi: false }],
'import/prefer-default-export': 'off', 'import/prefer-default-export': 'off',
'no-restricted-syntax': ['off', 'ForOfStatement'], 'no-restricted-syntax': ['off', 'ForOfStatement'],
'lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],
'@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off',
@@ -55,4 +60,12 @@ module.exports = {
}, },
], ],
}, },
overrides: [
{
files: ['**/tests/**/*.js', '**/tests/**/*.ts'], // Adjust the pattern to match your test files
rules: {
'import/extensions': 'off', // Turn off the rule for test files
},
},
],
} }
+1 -1
View File
@@ -29,7 +29,7 @@
"build:quests": "yarn workspace server build:quests" "build:quests": "yarn workspace server build:quests"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.11", "@types/jest": "^29.5.12",
"@types/node": "^20.10.4", "@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "^6.14.0", "@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0", "@typescript-eslint/parser": "^6.14.0",
+3 -1
View File
@@ -53,7 +53,9 @@ export default class DAG {
if (node.layer !== undefined) { if (node.layer !== undefined) {
return node.layer return node.layer
} }
const previousLayer = node.requirements.map((rId: string) => this.setLayer(rId)) const previousLayer = node.requirements.map((rId: string) =>
this.setLayer(rId)
)
node.layer = Math.max(...previousLayer, 0) + 1 node.layer = Math.max(...previousLayer, 0) + 1
if (this.layers.length < node.layer) { if (this.layers.length < node.layer) {
this.layers.push(1) this.layers.push(1)
+2 -1
View File
@@ -2,7 +2,8 @@
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "src", "rootDir": "src",
"outDir": "./dist" "outDir": "./dist",
"allowJs": false
}, },
"include": ["src"], "include": ["src"],
"exclude": ["node_modules", "dist"] "exclude": ["node_modules", "dist"]
+2 -2
View File
@@ -1460,7 +1460,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/jest@npm:^29.5.11": "@types/jest@npm:^29.5.12":
version: 29.5.12 version: 29.5.12
resolution: "@types/jest@npm:29.5.12" resolution: "@types/jest@npm:29.5.12"
dependencies: dependencies:
@@ -6495,7 +6495,7 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "linux-odyssey@workspace:." resolution: "linux-odyssey@workspace:."
dependencies: dependencies:
"@types/jest": "npm:^29.5.11" "@types/jest": "npm:^29.5.12"
"@types/node": "npm:^20.10.4" "@types/node": "npm:^20.10.4"
"@typescript-eslint/eslint-plugin": "npm:^6.14.0" "@typescript-eslint/eslint-plugin": "npm:^6.14.0"
"@typescript-eslint/parser": "npm:^6.14.0" "@typescript-eslint/parser": "npm:^6.14.0"