Configurations Reference
Following the ESLint conventions for sharing configurations, each of the configurations are named with a different prefix to indicate what kind of configuration it is.
Each configuration might consist of 1 or more sub configurations. Each of the tables below contains information about what rules have been configured for each sub configuration and for what files.
Some of the rules have URL links to documentation; you can click on the name of the rule to see the associated documentation page.
Dynamic Loading
This page is actually dynamically created based on the configuration objects exported by the Lint plugin alongside some clever Vue magic
This does mean that some of the configurations might have weird names as they are directly loaded from the recommended configurations provided from plugins.
js/recommended Configuration
SA Recommended Javascript Configuration > ExtendedConfig[0]
- Applies to:
**/*.*js**/*.ts**/*.tsx
Plugins Required:
@stylistic/eslint-plugin
Rules
Rule Severity Options @stylistic/array-bracket-spacingerror[ "never" ]@stylistic/arrow-parenserror[ "as-needed", { "requireForBlockBody": true } ]@stylistic/arrow-spacingerror[ { "after": true, "before": true } ]@stylistic/block-spacingerror[ "always" ]@stylistic/brace-styleerror[ "stroustrup", { "allowSingleLine": true } ]@stylistic/comma-dangleerror[ "always-multiline" ]@stylistic/comma-spacingerror[ { "after": true, "before": false } ]@stylistic/comma-styleerror[ "last" ]@stylistic/computed-property-spacingerror[ "never", { "enforceForClassMembers": true } ]@stylistic/dot-locationerror[ "property" ]@stylistic/eol-lasterror@stylistic/generator-star-spacingerror[ { "after": true, "before": false } ]@stylistic/indenterror[ 2, { "ArrayExpression": 1, "CallExpression": { "arguments": 1 }, "flatTernaryExpressions": false, "FunctionDeclaration": { "body": 1, "parameters": 1, "returnType": 1 }, "FunctionExpression": { "body": 1, "parameters": 1, "returnType": 1 }, "ignoreComments": false, "ignoredNodes": [ "TSUnionType", "TSIntersectionType" ], "ImportDeclaration": 1, "MemberExpression": 1, "ObjectExpression": 1, "offsetTernaryExpressions": true, "outerIIFEBody": 1, "SwitchCase": 1, "tabLength": 2, "VariableDeclarator": 1 } ]@stylistic/indent-binary-opserror[ 2 ]@stylistic/key-spacingerror[ { "afterColon": true, "beforeColon": false } ]@stylistic/keyword-spacingerror[ { "after": true, "before": true } ]@stylistic/lines-between-class-memberserror[ "always", { "exceptAfterSingleLine": true } ]@stylistic/max-statements-per-lineerror[ { "max": 1 } ]@stylistic/member-delimiter-styleerror[ { "multiline": { "delimiter": "none", "requireLast": false }, "multilineDetection": "brackets", "overrides": { "interface": { "multiline": { "delimiter": "none", "requireLast": false } } }, "singleline": { "delimiter": "comma" } } ]@stylistic/multiline-ternaryerror[ "always-multiline" ]@stylistic/new-parenserror@stylistic/no-extra-parenserror[ "functions" ]@stylistic/no-floating-decimalerror@stylistic/no-mixed-operatorserror[ { "allowSamePrecedence": true, "groups": [ [ "==", "!=", "===", "!==", ">", ">=", "<", "<=" ], [ "&&", "||" ], [ "in", "instanceof" ] ] } ]@stylistic/no-mixed-spaces-and-tabserror@stylistic/no-multi-spaceserror@stylistic/no-multiple-empty-lineserror[ { "max": 1, "maxBOF": 0, "maxEOF": 0 } ]@stylistic/no-tabserror@stylistic/no-trailing-spaceserror@stylistic/no-whitespace-before-propertyerror@stylistic/object-curly-spacingerror[ "always" ]@stylistic/operator-linebreakerror[ "before" ]@stylistic/padded-blockserror[ { "blocks": "never", "classes": "never", "switches": "never" } ]@stylistic/quote-propserror[ "consistent-as-needed" ]@stylistic/quoteserror[ "single", { "allowTemplateLiterals": "always", "avoidEscape": false } ]@stylistic/rest-spread-spacingerror[ "never" ]@stylistic/semierror[ "never" ]@stylistic/semi-spacingerror[ { "after": true, "before": false } ]@stylistic/space-before-blockserror[ "always" ]@stylistic/space-before-function-parenerror[ { "anonymous": "always", "asyncArrow": "always", "named": "never" } ]@stylistic/space-in-parenserror[ "never" ]@stylistic/space-infix-opserror@stylistic/space-unary-opserror[ { "nonwords": false, "words": true } ]@stylistic/spaced-commenterror[ "always", { "block": { "balanced": true, "exceptions": [ "*" ], "markers": [ "!" ] }, "line": { "exceptions": [ "/", "#" ], "markers": [ "/" ] } } ]@stylistic/template-curly-spacingerror@stylistic/template-tag-spacingerror[ "never" ]@stylistic/type-annotation-spacingerror[ {} ]@stylistic/type-generic-spacingerror@stylistic/type-named-tuple-spacingerror@stylistic/wrap-iifeerror[ "any", { "functionPrototypeMethods": true } ]@stylistic/yield-star-spacingerror[ { "after": true, "before": false } ]@stylistic/jsx-closing-bracket-locationerror@stylistic/jsx-closing-tag-locationerror@stylistic/jsx-curly-brace-presenceerror[ { "propElementValues": "always" } ]@stylistic/jsx-curly-newlineerror@stylistic/jsx-curly-spacingerror[ "never" ]@stylistic/jsx-equals-spacingerror@stylistic/jsx-first-prop-new-lineerror@stylistic/jsx-function-call-newlineerror[ "multiline" ]@stylistic/jsx-indent-propserror[ 2 ]@stylistic/jsx-max-props-per-lineerror[ { "maximum": 1, "when": "multiline" } ]@stylistic/jsx-one-expression-per-lineerror[ { "allow": "single-child" } ]@stylistic/jsx-quoteserror@stylistic/jsx-tag-spacingerror[ { "afterOpening": "never", "beforeClosing": "never", "beforeSelfClosing": "always", "closingSlash": "never" } ]@stylistic/jsx-wrap-multilineserror[ { "arrow": "parens-new-line", "assignment": "parens-new-line", "condition": "parens-new-line", "declaration": "parens-new-line", "logical": "parens-new-line", "prop": "parens-new-line", "propertyValue": "parens-new-line", "return": "parens-new-line" } ]
SA Recommended Javascript Configuration
- Applies to:
**/*.*js**/*.ts**/*.tsx
Plugins Required:
import
@sourceacademy
Rules
Rule Severity Options import/firstwarnimport/newline-after-importwarnimport/no-cycleerrorimport/no-duplicateswarn[ { "prefer-inline": false } ]import/no-useless-path-segmentserrorimport/orderwarn[ { "groups": [ "builtin", "external", "internal", "parent", "sibling", "index" ], "named": { "import": true, "types": "types-last" }, "alphabetize": { "order": "asc", "orderImportKind": "asc" } } ]no-emptyerror[ { "allowEmptyCatch": true } ]@sourceacademy/default-import-namewarn[ { "path": "pathlib" } ]@sourceacademy/region-commenterror@stylistic/brace-stylewarn[ "1tbs", { "allowSingleLine": true } ]@stylistic/function-call-spacingwarn[ "never" ]@stylistic/function-paren-newlinewarn[ "multiline-arguments" ]@stylistic/nonblock-statement-body-positionerror[ "beside" ]@stylistic/object-curly-newlinewarn[ { "ImportDeclaration": { "multiline": true } } ]@stylistic/object-curly-spacingwarn[ "always" ]@stylistic/quoteswarn[ "single", { "avoidEscape": true } ]@stylistic/semiwarn[ "always" ]
Rules for cjs files
- Applies to:
**/*.cjs
Rules
Rule Severity Options @typescript-eslint/no-require-importsoff
jsdoc/recommended Configuration
jsdoc/recommended
- Applies to:
**/*.*js**/*.ts**/*.tsx
Plugins Required:
jsdoc
Rules
Rule Severity Options jsdoc/check-alignmentwarnjsdoc/require-asterisk-prefixwarn
jsdoc/recommended
- Applies to:
**/*.ts**/*.tsx
Rules
Rule Severity Options jsdoc/no-typeswarn
md/recommended Configuration
Markdown Files > markdown/recommended
- Applies to:
[ "**/*.md", "**/*.md" ]
Plugins Required:
@eslint/markdown
Rules
Markdown Files
- Applies to:
**/*.md
Plugins Required:
@eslint/markdown
Rules
Rule Severity Options markdown/no-missing-label-refsoffmarkdown/no-multiple-h1offmarkdown/require-alt-textoff
style/recommended Configuration
style/recommended
- Applies to:
- Ignores:
[ "**/*.md" ] Plugins Required:
@stylistic/eslint-plugin
Rules
Rule Severity Options @stylistic/eol-lastwarn@stylistic/indentwarn[ 2, { "SwitchCase": 1 } ]@stylistic/no-mixed-spaces-and-tabswarn@stylistic/no-multiple-empty-lineswarn[ { "max": 1, "maxEOF": 0 } ]@stylistic/no-multi-spaceswarn[ { "ignoreEOLComments": true } ]@stylistic/no-trailing-spaceswarn@stylistic/spaced-commentwarn[ "always", { "markers": [ "TODO", "TODOS", "TODO WIP", "FIXME", "WIP", "NOTE", "NOTES", "LIST" ] } ]
ts/recommended Configuration
Global Typescript Rules__typescript-eslint/base
- Applies to:
**/*.{ts,tsx}
Plugins Required:
@typescript-eslint/eslint-plugin
This configuration has no rules.
Global Typescript Rules__typescript-eslint/eslint-recommended
- Applies to:
**/*.{ts,tsx}
Rules
Rule Severity Options constructor-superoffgetter-returnoffno-class-assignoffno-const-assignoffno-dupe-argsoffno-dupe-class-membersoffno-dupe-keysoffno-func-assignoffno-import-assignoffno-new-native-nonconstructoroffno-new-symboloffno-obj-callsoffno-redeclareoffno-setter-returnoffno-this-before-superoffno-undefoffno-unreachableoffno-unsafe-negationoffno-varerrorno-withoffprefer-consterrorprefer-rest-paramserrorprefer-spreaderror
Global Typescript Rules__typescript-eslint/recommended
- Applies to:
**/*.{ts,tsx}
Rules
Global Typescript Rules
- Applies to:
**/*.{ts,tsx}
Plugins Required:
@typescript-eslint/eslint-plugin
Rules
Rule Severity Options no-unused-varsoffjsdoc/no-typeswarn@stylistic/type-annotation-spacingwarn[ { "overrides": { "colon": { "before": false, "after": true } } } ]@typescript-eslint/ban-ts-commenterror@typescript-eslint/ban-typesoff@typescript-eslint/no-duplicate-type-constituentsoff@typescript-eslint/no-explicit-anyoff@typescript-eslint/no-import-type-side-effectserror@typescript-eslint/no-redundant-type-constituentsoff@typescript-eslint/no-unused-varswarn[ { "argsIgnorePattern": "^_" } ]
tsx/recommended Configuration
SA TSX Config > ExtendedConfig[0]
- Applies to:
**/*.tsx
Plugins Required:
react
Rules
Rule Severity Options react/display-nameerrorreact/jsx-keyerrorreact/jsx-no-comment-textnodeserrorreact/jsx-no-duplicate-propserrorreact/jsx-no-target-blankerrorreact/jsx-no-undeferrorreact/jsx-uses-reacterrorreact/jsx-uses-varserrorreact/no-children-properrorreact/no-danger-with-childrenerrorreact/no-deprecatederrorreact/no-direct-mutation-stateerrorreact/no-find-dom-nodeerrorreact/no-is-mountederrorreact/no-render-return-valueerrorreact/no-string-refserrorreact/no-unescaped-entitieserrorreact/no-unknown-propertyerrorreact/no-unsafeoffreact/prop-typeserrorreact/react-in-jsx-scopeerrorreact/require-render-returnerror
SA TSX Config > ExtendedConfig[1]
- Applies to:
**/*.tsx
Plugins Required:
react
Rules
Rule Severity Options react/react-in-jsx-scopeoffreact/jsx-uses-reactoff
SA TSX Config
- Applies to:
**/*.tsx
Plugins Required:
eslint-plugin-react-hooks
react
Rules
Rule Severity Options react-hooks/rules-of-hookserrorreact/jsx-keyoffreact/prefer-stateless-functionwarnreact/prop-typesoff@stylistic/jsx-equals-spacingwarn[ "never" ]@stylistic/jsx-indent-propswarn[ 2 ]@stylistic/jsx-props-no-multi-spaceswarn@stylistic/jsx-self-closing-compwarn
vitest/recommended Configuration
SA Recommended Vitest Config > vitest/recommended
- Applies to:
**/__tests__/**/*.ts***/__mocks__/**/*.ts***/vitest.*.ts
Plugins Required:
vitest
Rules
Rule Severity Options vitest/expect-expecterrorvitest/no-commented-out-testserrorvitest/no-conditional-expecterrorvitest/no-disabled-testswarnvitest/no-focused-testserrorvitest/no-identical-titleerrorvitest/no-import-node-testerrorvitest/no-interpolation-in-snapshotserrorvitest/no-mocks-importerrorvitest/no-standalone-expecterrorvitest/no-unneeded-async-expect-functionerrorvitest/prefer-called-exactly-once-witherrorvitest/require-local-test-context-for-concurrent-snapshotserrorvitest/valid-describe-callbackerrorvitest/valid-expecterrorvitest/valid-expect-in-promiseerrorvitest/valid-titleerror
SA Recommended Vitest Config
- Applies to:
**/__tests__/**/*.ts***/__mocks__/**/*.ts***/vitest.*.ts
Plugins Required:
vitest
Rules
Rule Severity Options no-empty-patternoff@stylistic/quotesoffvitest/expect-expecterror[ { "assertFunctionNames": [ "expect*" ] } ]vitest/no-alias-methodsoffvitest/no-conditional-expectoffvitest/no-exportoffvitest/no-focused-testswarn[ { "fixable": false } ]vitest/require-top-level-describeoffvitest/prefer-hooks-on-topwarnvitest/valid-describe-callbackoffvitest/valid-expect-in-promiseerrorimport/extensionserror[ "never", { "config": "ignore" } ]