mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 15:22:19 +02:00
Move away from ESLint linting
This commit is contained in:
parent
480be88508
commit
0cc2210848
@ -1,4 +1,4 @@
|
|||||||
name: ESLint
|
name: Biome Code Quality
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Trigger the workflow on push or pull request,
|
# Trigger the workflow on push or pull request,
|
||||||
@ -28,10 +28,14 @@ jobs:
|
|||||||
- name: Set up Node.js # Step to set up Node.js environment
|
- name: Set up Node.js # Step to set up Node.js environment
|
||||||
uses: actions/setup-node@v4 # Use the setup-node action version 4
|
uses: actions/setup-node@v4 # Use the setup-node action version 4
|
||||||
with:
|
with:
|
||||||
node-version: 20 # Specify Node.js version 20
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
- name: Install Node.js dependencies # Step to install Node.js dependencies
|
- name: Install Node.js dependencies # Step to install Node.js dependencies
|
||||||
run: npm ci # Use 'npm ci' to install dependencies
|
run: npm ci # Use 'npm ci' to install dependencies
|
||||||
|
|
||||||
- name: eslint # Step to run linters
|
- name: eslint # Step to run linters
|
||||||
run: npm run eslint-ci
|
run: npm run eslint-ci
|
||||||
|
|
||||||
|
|
||||||
|
- name: biome-lint # Step to run linters
|
||||||
|
run: npm run biome-ci
|
30
biome.jsonc
30
biome.jsonc
@ -7,14 +7,11 @@
|
|||||||
"defaultBranch": "beta"
|
"defaultBranch": "beta"
|
||||||
},
|
},
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"enabled": false
|
"enabled": true,
|
||||||
|
"useEditorconfig": true
|
||||||
},
|
},
|
||||||
"files": { "ignoreUnknown": false, "ignore": [] },
|
"files": {
|
||||||
"organizeImports": { "enabled": false },
|
"ignoreUnknown": false,
|
||||||
"linter": { "enabled": true, "rules": { "recommended": false } },
|
|
||||||
"javascript": { "formatter": { "quoteStyle": "double" } },
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"dist/*",
|
"dist/*",
|
||||||
"build/*",
|
"build/*",
|
||||||
@ -23,11 +20,13 @@
|
|||||||
".github/*",
|
".github/*",
|
||||||
"node_modules/*",
|
"node_modules/*",
|
||||||
".vscode/*"
|
".vscode/*"
|
||||||
],
|
]
|
||||||
"include": ["src/**/*.{ts,tsx,js,jsx}", "test/**/*.{ts,tsx,js,jsx}"],
|
},
|
||||||
"javascript": { "globals": [] },
|
"organizeImports": { "enabled": false },
|
||||||
"linter": {
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"recommended": true,
|
||||||
"correctness": {
|
"correctness": {
|
||||||
"noUndeclaredVariables": "off",
|
"noUndeclaredVariables": "off",
|
||||||
"noUnusedVariables": "error"
|
"noUnusedVariables": "error"
|
||||||
@ -36,13 +35,20 @@
|
|||||||
"noVar": "error",
|
"noVar": "error",
|
||||||
"useBlockStatements": "error",
|
"useBlockStatements": "error",
|
||||||
"useConst": "error",
|
"useConst": "error",
|
||||||
"useImportType": "error"
|
"useImportType": "error",
|
||||||
|
"useNamingConvention": "warn"
|
||||||
},
|
},
|
||||||
"suspicious": { "noDoubleEquals": "error" },
|
"suspicious": { "noDoubleEquals": "error" },
|
||||||
"complexity": { "noExcessiveCognitiveComplexity": "warn"}
|
"complexity": {
|
||||||
|
"noExcessiveCognitiveComplexity": "warn",
|
||||||
|
"useSimplifiedLogicExpression": "warn"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"javascript": {
|
||||||
|
"formatter": { "quoteStyle": "double", "arrowParentheses": "asNeeded" }
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
{
|
{
|
||||||
"include": ["test/**/*.test.ts"],
|
"include": ["test/**/*.test.ts"],
|
||||||
"javascript": { "globals": [] },
|
"javascript": { "globals": [] },
|
||||||
|
@ -17,37 +17,10 @@ export default [
|
|||||||
'@typescript-eslint': tseslint
|
'@typescript-eslint': tseslint
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
"eqeqeq": ["error", "always"], // Enforces the use of `===` and `!==` instead of `==` and `!=`
|
|
||||||
"indent": ["error", 2, { "SwitchCase": 1 }], // Enforces a 2-space indentation, enforces indentation of `case ...:` statements
|
|
||||||
"quotes": ["error", "double"], // Enforces the use of double quotes for strings
|
|
||||||
"no-var": "error", // Disallows the use of `var`, enforcing `let` or `const` instead
|
|
||||||
"prefer-const": "error", // Enforces the use of `const` for variables that are never reassigned
|
"prefer-const": "error", // Enforces the use of `const` for variables that are never reassigned
|
||||||
"no-undef": "off", // Disables the rule that disallows the use of undeclared variables (TypeScript handles this)
|
"no-undef": "off", // Disables the rule that disallows the use of undeclared variables (TypeScript handles this)
|
||||||
"@typescript-eslint/no-unused-vars": [ "error", {
|
|
||||||
"args": "none", // Allows unused function parameters. Useful for functions with specific signatures where not all parameters are always used.
|
|
||||||
"ignoreRestSiblings": true // Allows unused variables that are part of a rest property in object destructuring. Useful for excluding certain properties from an object while using the others.
|
|
||||||
}],
|
|
||||||
"eol-last": ["error", "always"], // Enforces at least one newline at the end of files
|
|
||||||
"@stylistic/ts/semi": ["error", "always"], // Requires semicolons for TypeScript-specific syntax
|
|
||||||
"semi": "off", // Disables the general semi rule for TypeScript files
|
|
||||||
"no-extra-semi": ["error"], // Disallows unnecessary semicolons for TypeScript-specific syntax
|
"no-extra-semi": ["error"], // Disallows unnecessary semicolons for TypeScript-specific syntax
|
||||||
"brace-style": "off", // Note: you must disable the base rule as it can report incorrect errors
|
|
||||||
"curly": ["error", "all"], // Enforces the use of curly braces for all control statements
|
|
||||||
"@stylistic/ts/brace-style": ["error", "1tbs"], // Enforces the following brace style: https://eslint.style/rules/js/brace-style#_1tbs
|
|
||||||
"no-trailing-spaces": ["error", { // Disallows trailing whitespace at the end of lines
|
|
||||||
"skipBlankLines": false, // Enforces the rule even on blank lines
|
|
||||||
"ignoreComments": false // Enforces the rule on lines containing comments
|
|
||||||
}],
|
|
||||||
"space-before-blocks": ["error", "always"], // Enforces a space before blocks
|
|
||||||
"keyword-spacing": ["error", { "before": true, "after": true }], // Enforces spacing before and after keywords
|
|
||||||
"comma-spacing": ["error", { "before": false, "after": true }], // Enforces spacing after commas
|
|
||||||
"import-x/extensions": ["error", "never", { "json": "always" }], // Enforces no extension for imports unless json
|
"import-x/extensions": ["error", "never", { "json": "always" }], // Enforces no extension for imports unless json
|
||||||
"array-bracket-spacing": ["error", "always", { "objectsInArrays": false, "arraysInArrays": false }], // Enforces consistent spacing inside array brackets
|
|
||||||
"object-curly-spacing": ["error", "always", { "arraysInObjects": false, "objectsInObjects": false }], // Enforces consistent spacing inside braces of object literals, destructuring assignments, and import/export specifiers
|
|
||||||
"computed-property-spacing": ["error", "never" ], // Enforces consistent spacing inside computed property brackets
|
|
||||||
"space-infix-ops": ["error", { "int32Hint": false }], // Enforces spacing around infix operators
|
|
||||||
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }], // Disallows multiple empty lines
|
|
||||||
"@typescript-eslint/consistent-type-imports": "error", // Enforces type-only imports wherever possible
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"eslint": "eslint --fix .",
|
"eslint": "eslint --fix .",
|
||||||
"eslint-ci": "eslint .",
|
"eslint-ci": "eslint .",
|
||||||
|
"biome": "biome check --write",
|
||||||
|
"biome-ci": "biome ci --changed",
|
||||||
"docs": "typedoc",
|
"docs": "typedoc",
|
||||||
"depcruise": "depcruise src",
|
"depcruise": "depcruise src",
|
||||||
"depcruise:graph": "depcruise src --output-type dot | node dependency-graph.js > dependency-graph.svg",
|
"depcruise:graph": "depcruise src --output-type dot | node dependency-graph.js > dependency-graph.svg",
|
||||||
|
Loading…
Reference in New Issue
Block a user