forked from Infinite-Chess/infinitechess.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Infinite-Chess#264 from Heinrich-XIAO/main
Fix indentation everywhere else
- Loading branch information
Showing
7 changed files
with
281 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,53 @@ | ||
/* eslint-disable indent */ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
|
||
export default [ | ||
pluginJs.configs.recommended, | ||
{ | ||
rules: { // Overrides the preset defined by "pluginJs.configs.recommended" above | ||
'no-undef': 'error', // Undefined variables not allowed | ||
'no-unused-vars': 'warn', // Unused variables give a warning | ||
'semi': ['error', 'always'], // Enforces semicolons be present at the end of every line. | ||
'semi-spacing': ['error', { // Enforces semicolons have a space after them if they are proceeded by other statements. | ||
before: false, | ||
after: true, | ||
}], | ||
'keyword-spacing': ['error', { // Requires a space be after if, else, for, and while's. | ||
before: true, | ||
after: true, | ||
}], | ||
"space-before-function-paren": ["error", "never"], // Enforces there be NO space between function DECLARATIONS and () | ||
"space-before-blocks": ["error", "always"], // Enforces there be a space between function parameters and the {} block | ||
"arrow-spacing": ["error", { "before": true, "after": true }], // Requires a space before and after "=>" in arrow functions | ||
"func-call-spacing": ["error", "never"], // Enforces there be NO space between function CALLS and () | ||
"space-infix-ops": ["error", { "int32Hint": false }], // Enforces a space around infix operators, like "=" in assignments | ||
"no-eval": "error", // Disallows use of `eval()`, as it can lead to security vulnerabilities and performance issues. | ||
'indent': ['error', 'tab', { // All indentation must use tabs | ||
'SwitchCase': 1, // Enforce switch statements to have indentation (they don't by default) | ||
"ignoredNodes": ["ConditionalExpression", "ArrayExpression"] // Ignore conditional expressions "?" & ":" over multiple lines, AND array contents over multiple lines! | ||
}], | ||
"prefer-const": "error", // "let" variables that are never redeclared must be declared as "const" | ||
"no-var": "error", // Disallows declaring variables with "var", as they are function-scoped (not block), so hoisting is very confusing. | ||
"max-depth": ["warn", 4], // Maximum number of nested blocks allowed. | ||
"eqeqeq": ["error", "always"], // Disallows "!=" and "==" to remove type coercion bugs. Use "!==" and "===" instead. | ||
'dot-notation': 'error', // Forces dot notation `.` instead of bracket notation `[""]` wherever possible | ||
'no-empty': 'off', // Disable the no-empty rule so blocks aren't entirely red just as we create them | ||
'no-prototype-builtins': 'off', // Allows Object.hasOwnProperty() to be used | ||
// "no-multi-spaces": "error", // Disallows multiple spaces that isn't indentation. | ||
// "max-lines": ["warn", 500] // Can choose to enable to place a cap on how big files can be, in lines. | ||
// "complexity": ["warn", { "max": 10 }] // Can choose to enable to cap the complexity, or number of independant paths, which can lead to methods. | ||
}, | ||
languageOptions: { | ||
sourceType: "module", // Can also be "commonjs", but "import" and "export" statements will give an eslint error | ||
globals: { | ||
...globals.node, // Defines "require" and "exports" | ||
...globals.browser, // Defines all browser environment variables for the game code | ||
// Game code scripts are considered public variables | ||
// MOST OF THE GAME SCRIPTS are ESM scripts, importing their own definitions, so we don't need to list them below. | ||
translations: "readonly", // Injected into the html through ejs | ||
memberHeader: "readonly", | ||
htmlscript: "readonly", | ||
} | ||
} | ||
} | ||
pluginJs.configs.recommended, | ||
{ | ||
rules: { // Overrides the preset defined by "pluginJs.configs.recommended" above | ||
'no-undef': 'error', // Undefined variables not allowed | ||
'no-unused-vars': 'warn', // Unused variables give a warning | ||
'semi': ['error', 'always'], // Enforces semicolons be present at the end of every line. | ||
'semi-spacing': ['error', { // Enforces semicolons have a space after them if they are proceeded by other statements. | ||
before: false, | ||
after: true, | ||
}], | ||
'keyword-spacing': ['error', { // Requires a space be after if, else, for, and while's. | ||
before: true, | ||
after: true, | ||
}], | ||
"space-before-function-paren": ["error", "never"], // Enforces there be NO space between function DECLARATIONS and () | ||
"space-before-blocks": ["error", "always"], // Enforces there be a space between function parameters and the {} block | ||
"arrow-spacing": ["error", { "before": true, "after": true }], // Requires a space before and after "=>" in arrow functions | ||
"func-call-spacing": ["error", "never"], // Enforces there be NO space between function CALLS and () | ||
"space-infix-ops": ["error", { "int32Hint": false }], // Enforces a space around infix operators, like "=" in assignments | ||
"no-eval": "error", // Disallows use of `eval()`, as it can lead to security vulnerabilities and performance issues. | ||
'indent': ['error', 'tab', { // All indentation must use tabs | ||
'SwitchCase': 1, // Enforce switch statements to have indentation (they don't by default) | ||
"ignoredNodes": ["ConditionalExpression", "ArrayExpression"] // Ignore conditional expressions "?" & ":" over multiple lines, AND array contents over multiple lines! | ||
}], | ||
"prefer-const": "error", // "let" variables that are never redeclared must be declared as "const" | ||
"no-var": "error", // Disallows declaring variables with "var", as they are function-scoped (not block), so hoisting is very confusing. | ||
"max-depth": ["warn", 4], // Maximum number of nested blocks allowed. | ||
"eqeqeq": ["error", "always"], // Disallows "!=" and "==" to remove type coercion bugs. Use "!==" and "===" instead. | ||
'dot-notation': 'error', // Forces dot notation `.` instead of bracket notation `[""]` wherever possible | ||
'no-empty': 'off', // Disable the no-empty rule so blocks aren't entirely red just as we create them | ||
'no-prototype-builtins': 'off', // Allows Object.hasOwnProperty() to be used | ||
// "no-multi-spaces": "error", // Disallows multiple spaces that isn't indentation. | ||
// "max-lines": ["warn", 500] // Can choose to enable to place a cap on how big files can be, in lines. | ||
// "complexity": ["warn", { "max": 10 }] // Can choose to enable to cap the complexity, or number of independant paths, which can lead to methods. | ||
}, | ||
languageOptions: { | ||
sourceType: "module", // Can also be "commonjs", but "import" and "export" statements will give an eslint error | ||
globals: { | ||
...globals.node, // Defines "require" and "exports" | ||
...globals.browser, // Defines all browser environment variables for the game code | ||
// Game code scripts are considered public variables | ||
// MOST OF THE GAME SCRIPTS are ESM scripts, importing their own definitions, so we don't need to list them below. | ||
translations: "readonly", // Injected into the html through ejs | ||
memberHeader: "readonly", | ||
htmlscript: "readonly", | ||
} | ||
} | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"target": "ES2020", | ||
"jsx": "react", | ||
"allowImportingTsExtensions": true, | ||
"strictNullChecks": true, | ||
"strictFunctionTypes": true | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"**/node_modules/*" | ||
] | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"target": "ES2020", | ||
"jsx": "react", | ||
"allowImportingTsExtensions": true, | ||
"strictNullChecks": true, | ||
"strictFunctionTypes": true | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"**/node_modules/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"ignore": [ | ||
"./database/**/*", | ||
"./dist/**/*", | ||
"./docs/*" | ||
], | ||
"exec": "npm run build && npm run start", | ||
"ext": "js,html,css,jpg,png,gif,mp3,wav,webp,toml,ejs,json,mjs,md" | ||
"ignore": [ | ||
"./database/**/*", | ||
"./dist/**/*", | ||
"./docs/*" | ||
], | ||
"exec": "npm run build && npm run start", | ||
"ext": "js,html,css,jpg,png,gif,mp3,wav,webp,toml,ejs,json,mjs,md" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
{ | ||
"name": "infinite-chess-server", | ||
"version": "1.4.3", | ||
"description": "infinitechess.org server", | ||
"author": "Naviary", | ||
"license": "AGPL", | ||
"main": "src/server/server.js", | ||
"type": "module", | ||
"dependencies": { | ||
"@swc/core": "^1.7.0", | ||
"bcrypt": "^5.1.1", | ||
"browserslist": "^4.23.2", | ||
"cookie-parser": "^1.4.6", | ||
"cors": "^2.8.5", | ||
"date-fns": "^2.23.0", | ||
"dotenv": "^16.0.3", | ||
"ejs": "^3.1.10", | ||
"esbuild": "^0.23.1", | ||
"express": "^4.18.2", | ||
"glob": "^11.0.0", | ||
"i18next": "^23.12.1", | ||
"i18next-http-middleware": "^3.6.0", | ||
"jsonwebtoken": "^9.0.2", | ||
"lightningcss": "^1.25.1", | ||
"marked": "^14.1.2", | ||
"node-forge": "^1.3.1", | ||
"nodemailer": "^6.8.0", | ||
"nodemon": "^3.1.4", | ||
"proper-lockfile": "^4.1.2", | ||
"sharp": "^0.33.4", | ||
"smol-toml": "^1.2.2", | ||
"uuid": "^8.3.2", | ||
"ws": "^8.16.0", | ||
"xss": "^1.0.15" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.9.0", | ||
"@types/node": "^20.14.10", | ||
"eslint": "^9.9.0", | ||
"globals": "^15.9.0", | ||
"madge": "^8.0.0" | ||
}, | ||
"scripts": { | ||
"build": "node build.js", | ||
"watch": "nodemon", | ||
"start": "node .", | ||
"build-images": "node src/server/utility/generateImages.js", | ||
"generate-dependancy-graph": "node src/server/utility/generateDependancyGraph.js" | ||
} | ||
"name": "infinite-chess-server", | ||
"version": "1.4.3", | ||
"description": "infinitechess.org server", | ||
"author": "Naviary", | ||
"license": "AGPL", | ||
"main": "src/server/server.js", | ||
"type": "module", | ||
"dependencies": { | ||
"@swc/core": "^1.7.0", | ||
"bcrypt": "^5.1.1", | ||
"browserslist": "^4.23.2", | ||
"cookie-parser": "^1.4.6", | ||
"cors": "^2.8.5", | ||
"date-fns": "^2.23.0", | ||
"dotenv": "^16.0.3", | ||
"ejs": "^3.1.10", | ||
"esbuild": "^0.23.1", | ||
"express": "^4.18.2", | ||
"glob": "^11.0.0", | ||
"i18next": "^23.12.1", | ||
"i18next-http-middleware": "^3.6.0", | ||
"jsonwebtoken": "^9.0.2", | ||
"lightningcss": "^1.25.1", | ||
"marked": "^14.1.2", | ||
"node-forge": "^1.3.1", | ||
"nodemailer": "^6.8.0", | ||
"nodemon": "^3.1.4", | ||
"proper-lockfile": "^4.1.2", | ||
"sharp": "^0.33.4", | ||
"smol-toml": "^1.2.2", | ||
"uuid": "^8.3.2", | ||
"ws": "^8.16.0", | ||
"xss": "^1.0.15" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.9.0", | ||
"@types/node": "^20.14.10", | ||
"eslint": "^9.9.0", | ||
"globals": "^15.9.0", | ||
"madge": "^8.0.0" | ||
}, | ||
"scripts": { | ||
"build": "node build.js", | ||
"watch": "nodemon", | ||
"start": "node .", | ||
"build-images": "node src/server/utility/generateImages.js", | ||
"generate-dependancy-graph": "node src/server/utility/generateDependancyGraph.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"target": "ES2020", | ||
"jsx": "react", | ||
"allowImportingTsExtensions": true, | ||
"strictNullChecks": true, | ||
"strictFunctionTypes": true | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"**/node_modules/*" | ||
] | ||
} | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"target": "ES2020", | ||
"jsx": "react", | ||
"allowImportingTsExtensions": true, | ||
"strictNullChecks": true, | ||
"strictFunctionTypes": true | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"**/node_modules/*" | ||
] | ||
} |
Oops, something went wrong.