forked from tgstation/tgstation
-
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.
tgui: ESLint and VSCode settings improvements (tgstation#57905)
Added column 80 rulers to all javascript and scss files. Added a "prettier" config to have sensible defaults for those who prefer to use it. Added RadarJS (fork of SonarQube's SonarJS). Launchable only via bin/tgui --lint-harder for now. Disabled ESLint rule for parens around arrow function arguments, because in TypeScript they're pretty much always required, and I don't want to replace it throughout the codebase. Removed unused javascript extensions from tooling (jsx, mjs).
- Loading branch information
1 parent
92805c7
commit 8080a51
Showing
12 changed files
with
86 additions
and
28 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
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,43 @@ | ||
rules: | ||
## Enforce a maximum cyclomatic complexity allowed in a program | ||
complexity: [error, { max: 25 }] | ||
# complexity: [warn, { max: 25 }] | ||
## Enforce consistent brace style for blocks | ||
brace-style: [error, stroustrup, { allowSingleLine: false }] | ||
# brace-style: [warn, stroustrup, { allowSingleLine: false }] | ||
## Enforce the consistent use of either backticks, double, or single quotes | ||
quotes: [error, single, { | ||
avoidEscape: true, | ||
allowTemplateLiterals: true, | ||
}] | ||
react/jsx-closing-bracket-location: [error, { | ||
selfClosing: after-props, | ||
nonEmpty: after-props, | ||
}] | ||
react/display-name: error | ||
# quotes: [warn, single, { | ||
# avoidEscape: true, | ||
# allowTemplateLiterals: true, | ||
# }] | ||
# react/jsx-closing-bracket-location: [warn, { | ||
# selfClosing: after-props, | ||
# nonEmpty: after-props, | ||
# }] | ||
# react/display-name: warn | ||
|
||
## Radar | ||
## ------------------------------------------------------ | ||
# radar/cognitive-complexity: warn | ||
radar/max-switch-cases: warn | ||
radar/no-all-duplicated-branches: warn | ||
radar/no-collapsible-if: warn | ||
radar/no-collection-size-mischeck: warn | ||
radar/no-duplicate-string: warn | ||
radar/no-duplicated-branches: warn | ||
radar/no-element-overwrite: warn | ||
radar/no-extra-arguments: warn | ||
radar/no-identical-conditions: warn | ||
radar/no-identical-expressions: warn | ||
radar/no-identical-functions: warn | ||
radar/no-inverted-boolean-check: warn | ||
radar/no-one-iteration-loop: warn | ||
radar/no-redundant-boolean: warn | ||
radar/no-redundant-jump: warn | ||
radar/no-same-line-conditional: warn | ||
radar/no-small-switch: warn | ||
radar/no-unused-collection: warn | ||
radar/no-use-of-empty-return-value: warn | ||
radar/no-useless-catch: warn | ||
radar/prefer-immediate-return: warn | ||
radar/prefer-object-literal: warn | ||
radar/prefer-single-boolean-return: warn | ||
radar/prefer-while: warn |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
arrowParens: always | ||
bracketSpacing: true | ||
endOfLine: lf | ||
jsxBracketSameLine: true | ||
jsxSingleQuote: false | ||
printWidth: 80 | ||
proseWrap: preserve | ||
quoteProps: preserve | ||
semi: true | ||
singleQuote: true | ||
tabWidth: 2 | ||
trailingComma: es5 |
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
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,14 +1,14 @@ | ||
module.exports = { | ||
roots: ['<rootDir>/packages'], | ||
testMatch: [ | ||
'<rootDir>/packages/**/__tests__/*.{js,jsx,ts,tsx}', | ||
'<rootDir>/packages/**/*.{spec,test}.{js,jsx,ts,tsx}', | ||
'<rootDir>/packages/**/__tests__/*.{js,ts,tsx}', | ||
'<rootDir>/packages/**/*.{spec,test}.{js,ts,tsx}', | ||
], | ||
testEnvironment: 'jsdom', | ||
testRunner: require.resolve('jest-circus/runner'), | ||
transform: { | ||
'^.+\\.(js|jsx|ts|tsx|cjs|mjs)$': require.resolve('babel-jest'), | ||
'^.+\\.(js|cjs|ts|tsx)$': require.resolve('babel-jest'), | ||
}, | ||
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'], | ||
moduleFileExtensions: ['js', 'cjs', 'ts', 'tsx', 'json'], | ||
resetMocks: true, | ||
}; |
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
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