@prairielearn/eslint-config 1.1.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/configs/base.d.ts.map +1 -1
- package/dist/configs/base.js +1 -1
- package/dist/configs/base.js.map +1 -1
- package/dist/configs/imports.js.map +1 -1
- package/dist/configs/jsdoc.js.map +1 -1
- package/dist/configs/lodash.js.map +1 -1
- package/dist/configs/perfectionist.js.map +1 -1
- package/dist/configs/prairielearn.js.map +1 -1
- package/dist/configs/react.js.map +1 -1
- package/dist/configs/stylistic.js.map +1 -1
- package/dist/configs/tanstack.js.map +1 -1
- package/dist/configs/typescript.js.map +1 -1
- package/dist/configs/unicorn.js.map +1 -1
- package/dist/configs/vitest.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
- package/src/configs/base.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @prairielearn/eslint-config
|
|
2
2
|
|
|
3
|
+
## 2.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 144cd19: Upgrade all JavaScript dependencies
|
|
8
|
+
|
|
9
|
+
## 2.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- 3c4799a: Upgrade to ESLint v10
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 3c4799a: Upgrade all JavaScript dependencies
|
|
18
|
+
- 3c4799a: Disable the radix rule
|
|
19
|
+
- Updated dependencies [3c4799a]
|
|
20
|
+
- Updated dependencies [3c4799a]
|
|
21
|
+
- @prairielearn/eslint-plugin@4.0.0
|
|
22
|
+
|
|
3
23
|
## 1.1.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD;;;GAGG;AACH,wBAAgB,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,WAAW,CAqH5D","sourcesContent":["import js from '@eslint/js';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport noFloatingPromise from 'eslint-plugin-no-floating-promise';\nimport globals from 'globals';\n\n/**\n * Base JavaScript/TypeScript configuration.\n * Core rules that apply to all JS/TS files.\n */\nexport function baseConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n languageOptions: {\n globals: { ...globals.node },\n },\n\n linterOptions: {\n reportUnusedDisableDirectives: 'error',\n },\n\n plugins: {\n 'no-floating-promise': noFloatingPromise,\n },\n\n rules: {\n ...js.configs.all.rules,\n 'array-callback-return': 'off',\n 'arrow-body-style': 'off',\n camelcase: 'off',\n 'capitalized-comments': 'off',\n 'class-methods-use-this': 'off',\n complexity: 'off',\n 'consistent-return': 'off',\n 'consistent-this': 'off',\n curly: ['error', 'multi-line', 'consistent'],\n 'default-case': 'off',\n 'dot-notation': 'off',\n eqeqeq: ['error', 'smart'],\n 'func-names': 'off',\n 'func-style': 'off',\n 'guard-for-in': 'off',\n 'handle-callback-err': 'error',\n 'id-length': 'off',\n 'init-declarations': 'off',\n 'logical-assignment-operators': 'off',\n 'max-classes-per-file': 'off',\n 'max-depth': 'off',\n 'max-lines': 'off',\n 'max-lines-per-function': 'off',\n 'max-params': ['error', { max: 6 }],\n 'max-statements': 'off',\n 'new-cap': 'off',\n 'no-await-in-loop': 'off',\n 'no-bitwise': 'off',\n 'no-console': ['error', { allow: ['warn', 'error', 'table', 'trace'] }],\n 'no-continue': 'off',\n 'no-duplicate-imports': 'error',\n 'no-else-return': 'off',\n 'no-empty-function': 'off',\n 'no-eq-null': 'off',\n 'no-implicit-coercion': 'off',\n 'no-inline-comments': 'off',\n 'no-invalid-this': 'off',\n 'no-lonely-if': 'off',\n 'no-loop-func': 'off',\n 'no-magic-numbers': 'off',\n 'no-negated-condition': 'off',\n 'no-nested-ternary': 'off',\n 'no-new': 'off',\n 'no-param-reassign': 'off',\n 'no-plusplus': 'off',\n 'no-promise-executor-return': 'off',\n 'no-redeclare': 'off',\n 'no-restricted-globals': [\n 'error',\n // These are not available in ES modules.\n '__filename',\n '__dirname',\n ],\n 'no-shadow': 'off',\n 'no-template-curly-in-string': 'error',\n 'no-ternary': 'off',\n 'no-undef': 'off',\n 'no-undef-init': 'off',\n 'no-undefined': 'off',\n 'no-underscore-dangle': 'off',\n 'no-unmodified-loop-condition': 'off',\n 'no-unneeded-ternary': 'off',\n 'no-unused-vars': 'off',\n 'no-use-before-define': 'off',\n 'no-useless-assignment': 'off',\n 'no-useless-concat': 'off',\n 'no-useless-constructor': 'off',\n 'no-useless-return': 'off',\n 'no-void': 'off', // https://typescript-eslint.io/rules/no-floating-promises/#ignorevoid\n 'no-warning-comments': 'off',\n 'object-shorthand': 'error',\n 'one-var': ['off', 'never'],\n 'prefer-arrow-callback': 'off',\n 'prefer-const': ['error', { destructuring: 'all' }],\n 'prefer-destructuring': 'off',\n 'prefer-named-capture-group': 'off',\n 'prefer-object-has-own': 'off',\n 'prefer-template': 'off',\n radix: ['
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD;;;GAGG;AACH,wBAAgB,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,WAAW,CAqH5D","sourcesContent":["import js from '@eslint/js';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport noFloatingPromise from 'eslint-plugin-no-floating-promise';\nimport globals from 'globals';\n\n/**\n * Base JavaScript/TypeScript configuration.\n * Core rules that apply to all JS/TS files.\n */\nexport function baseConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n languageOptions: {\n globals: { ...globals.node },\n },\n\n linterOptions: {\n reportUnusedDisableDirectives: 'error',\n },\n\n plugins: {\n 'no-floating-promise': noFloatingPromise,\n },\n\n rules: {\n ...js.configs.all.rules,\n 'array-callback-return': 'off',\n 'arrow-body-style': 'off',\n camelcase: 'off',\n 'capitalized-comments': 'off',\n 'class-methods-use-this': 'off',\n complexity: 'off',\n 'consistent-return': 'off',\n 'consistent-this': 'off',\n curly: ['error', 'multi-line', 'consistent'],\n 'default-case': 'off',\n 'dot-notation': 'off',\n eqeqeq: ['error', 'smart'],\n 'func-names': 'off',\n 'func-style': 'off',\n 'guard-for-in': 'off',\n 'handle-callback-err': 'error',\n 'id-length': 'off',\n 'init-declarations': 'off',\n 'logical-assignment-operators': 'off',\n 'max-classes-per-file': 'off',\n 'max-depth': 'off',\n 'max-lines': 'off',\n 'max-lines-per-function': 'off',\n 'max-params': ['error', { max: 6 }],\n 'max-statements': 'off',\n 'new-cap': 'off',\n 'no-await-in-loop': 'off',\n 'no-bitwise': 'off',\n 'no-console': ['error', { allow: ['warn', 'error', 'table', 'trace'] }],\n 'no-continue': 'off',\n 'no-duplicate-imports': 'error',\n 'no-else-return': 'off',\n 'no-empty-function': 'off',\n 'no-eq-null': 'off',\n 'no-implicit-coercion': 'off',\n 'no-inline-comments': 'off',\n 'no-invalid-this': 'off',\n 'no-lonely-if': 'off',\n 'no-loop-func': 'off',\n 'no-magic-numbers': 'off',\n 'no-negated-condition': 'off',\n 'no-nested-ternary': 'off',\n 'no-new': 'off',\n 'no-param-reassign': 'off',\n 'no-plusplus': 'off',\n 'no-promise-executor-return': 'off',\n 'no-redeclare': 'off',\n 'no-restricted-globals': [\n 'error',\n // These are not available in ES modules.\n '__filename',\n '__dirname',\n ],\n 'no-shadow': 'off',\n 'no-template-curly-in-string': 'error',\n 'no-ternary': 'off',\n 'no-undef': 'off',\n 'no-undef-init': 'off',\n 'no-undefined': 'off',\n 'no-underscore-dangle': 'off',\n 'no-unmodified-loop-condition': 'off',\n 'no-unneeded-ternary': 'off',\n 'no-unused-vars': 'off',\n 'no-use-before-define': 'off',\n 'no-useless-assignment': 'off',\n 'no-useless-concat': 'off',\n 'no-useless-constructor': 'off',\n 'no-useless-return': 'off',\n 'no-void': 'off', // https://typescript-eslint.io/rules/no-floating-promises/#ignorevoid\n 'no-warning-comments': 'off',\n 'object-shorthand': 'error',\n 'one-var': ['off', 'never'],\n 'prefer-arrow-callback': 'off',\n 'prefer-const': ['error', { destructuring: 'all' }],\n 'prefer-destructuring': 'off',\n 'prefer-named-capture-group': 'off',\n 'prefer-object-has-own': 'off',\n 'prefer-template': 'off',\n radix: ['off'], // We should never rely on this for parsing non-decimal numbers.\n 'require-atomic-updates': 'off',\n 'require-await': 'off',\n 'require-unicode-regexp': 'off',\n 'sort-vars': 'off',\n 'sort-keys': 'off',\n\n // Floating promise detection\n 'no-floating-promise/no-floating-promise': 'error',\n\n // Sort imports within a single import statement\n 'sort-imports': [\n 'error',\n {\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n },\n ],\n },\n },\n ];\n}\n"]}
|
package/dist/configs/base.js
CHANGED
|
@@ -97,7 +97,7 @@ export function baseConfig() {
|
|
|
97
97
|
'prefer-named-capture-group': 'off',
|
|
98
98
|
'prefer-object-has-own': 'off',
|
|
99
99
|
'prefer-template': 'off',
|
|
100
|
-
radix: ['
|
|
100
|
+
radix: ['off'], // We should never rely on this for parsing non-decimal numbers.
|
|
101
101
|
'require-atomic-updates': 'off',
|
|
102
102
|
'require-await': 'off',
|
|
103
103
|
'require-unicode-regexp': 'off',
|
package/dist/configs/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B;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B,mBAAmB,EAAE,KAAK;gBAC1B,SAAS,EAAE,KAAK,EAAE,sEAAsE;gBACxF,qBAAqB,EAAE,KAAK;gBAC5B,kBAAkB,EAAE,OAAO;gBAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;gBAC3B,uBAAuB,EAAE,KAAK;gBAC9B,cAAc,EAAE,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;gBACnD,sBAAsB,EAAE,KAAK;gBAC7B,4BAA4B,EAAE,KAAK;gBACnC,uBAAuB,EAAE,KAAK;gBAC9B,iBAAiB,EAAE,KAAK;gBACxB,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,gEAAgE;gBAChF,wBAAwB,EAAE,KAAK;gBAC/B,eAAe,EAAE,KAAK;gBACtB,wBAAwB,EAAE,KAAK;gBAC/B,WAAW,EAAE,KAAK;gBAClB,WAAW,EAAE,KAAK;gBAElB,6BAA6B;gBAC7B,yCAAyC,EAAE,OAAO;gBAElD,gDAAgD;gBAChD,cAAc,EAAE;oBACd,OAAO;oBACP;wBACE,qBAAqB,EAAE,IAAI;wBAC3B,gBAAgB,EAAE,KAAK;wBACvB,qBAAqB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC;qBAC7D;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import js from '@eslint/js';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport noFloatingPromise from 'eslint-plugin-no-floating-promise';\nimport globals from 'globals';\n\n/**\n * Base JavaScript/TypeScript configuration.\n * Core rules that apply to all JS/TS files.\n */\nexport function baseConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n languageOptions: {\n globals: { ...globals.node },\n },\n\n linterOptions: {\n reportUnusedDisableDirectives: 'error',\n },\n\n plugins: {\n 'no-floating-promise': noFloatingPromise,\n },\n\n rules: {\n ...js.configs.all.rules,\n 'array-callback-return': 'off',\n 'arrow-body-style': 'off',\n camelcase: 'off',\n 'capitalized-comments': 'off',\n 'class-methods-use-this': 'off',\n complexity: 'off',\n 'consistent-return': 'off',\n 'consistent-this': 'off',\n curly: ['error', 'multi-line', 'consistent'],\n 'default-case': 'off',\n 'dot-notation': 'off',\n eqeqeq: ['error', 'smart'],\n 'func-names': 'off',\n 'func-style': 'off',\n 'guard-for-in': 'off',\n 'handle-callback-err': 'error',\n 'id-length': 'off',\n 'init-declarations': 'off',\n 'logical-assignment-operators': 'off',\n 'max-classes-per-file': 'off',\n 'max-depth': 'off',\n 'max-lines': 'off',\n 'max-lines-per-function': 'off',\n 'max-params': ['error', { max: 6 }],\n 'max-statements': 'off',\n 'new-cap': 'off',\n 'no-await-in-loop': 'off',\n 'no-bitwise': 'off',\n 'no-console': ['error', { allow: ['warn', 'error', 'table', 'trace'] }],\n 'no-continue': 'off',\n 'no-duplicate-imports': 'error',\n 'no-else-return': 'off',\n 'no-empty-function': 'off',\n 'no-eq-null': 'off',\n 'no-implicit-coercion': 'off',\n 'no-inline-comments': 'off',\n 'no-invalid-this': 'off',\n 'no-lonely-if': 'off',\n 'no-loop-func': 'off',\n 'no-magic-numbers': 'off',\n 'no-negated-condition': 'off',\n 'no-nested-ternary': 'off',\n 'no-new': 'off',\n 'no-param-reassign': 'off',\n 'no-plusplus': 'off',\n 'no-promise-executor-return': 'off',\n 'no-redeclare': 'off',\n 'no-restricted-globals': [\n 'error',\n // These are not available in ES modules.\n '__filename',\n '__dirname',\n ],\n 'no-shadow': 'off',\n 'no-template-curly-in-string': 'error',\n 'no-ternary': 'off',\n 'no-undef': 'off',\n 'no-undef-init': 'off',\n 'no-undefined': 'off',\n 'no-underscore-dangle': 'off',\n 'no-unmodified-loop-condition': 'off',\n 'no-unneeded-ternary': 'off',\n 'no-unused-vars': 'off',\n 'no-use-before-define': 'off',\n 'no-useless-assignment': 'off',\n 'no-useless-concat': 'off',\n 'no-useless-constructor': 'off',\n 'no-useless-return': 'off',\n 'no-void': 'off', // https://typescript-eslint.io/rules/no-floating-promises/#ignorevoid\n 'no-warning-comments': 'off',\n 'object-shorthand': 'error',\n 'one-var': ['off', 'never'],\n 'prefer-arrow-callback': 'off',\n 'prefer-const': ['error', { destructuring: 'all' }],\n 'prefer-destructuring': 'off',\n 'prefer-named-capture-group': 'off',\n 'prefer-object-has-own': 'off',\n 'prefer-template': 'off',\n radix: ['off'], // We should never rely on this for parsing non-decimal numbers.\n 'require-atomic-updates': 'off',\n 'require-await': 'off',\n 'require-unicode-regexp': 'off',\n 'sort-vars': 'off',\n 'sort-keys': 'off',\n\n // Floating promise detection\n 'no-floating-promise/no-floating-promise': 'error',\n\n // Sort imports within a single import statement\n 'sort-imports': [\n 'error',\n {\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n },\n ],\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../src/configs/imports.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,aAAa
|
|
1
|
+
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../src/configs/imports.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL;YACE,OAAO,EAAE;gBACP,UAAU,EAAE,OAAO;aACpB;YAED,KAAK,EAAE;gBACL,4EAA4E;gBAC5E,4EAA4E;gBAC5E,gBAAgB,EAAE;oBAChB,OAAO;oBACP;wBACE,WAAW,EAAE;4BACX,KAAK,EAAE,KAAK;yBACb;wBAED,kBAAkB,EAAE,QAAQ;wBAE5B,UAAU,EAAE;4BACV;gCACE,KAAK,EAAE,UAAU;gCACjB,OAAO,EAAE,kBAAkB;gCAC3B,QAAQ,EAAE,OAAO;6BAClB;yBACF;wBAED,6BAA6B,EAAE,CAAC,SAAS,CAAC;qBAC3C;iBACF;aACF;YAED,QAAQ,EAAE;gBACR,kBAAkB,EAAE;oBAClB,2BAA2B,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;iBAC5C;gBACD,mBAAmB,EAAE;oBACnB,IAAI,EAAE,IAAI;oBACV,UAAU,EAAE,IAAI;iBACjB;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport importX from 'eslint-plugin-import-x';\n\n/**\n * Import ordering and resolution rules.\n */\nexport function importsConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n 'import-x': importX,\n },\n\n rules: {\n // Enforce alphabetical order of import specifiers within each import group.\n // The import-x/order rule handles the overall sorting of the import groups.\n 'import-x/order': [\n 'error',\n {\n alphabetize: {\n order: 'asc',\n },\n\n 'newlines-between': 'always',\n\n pathGroups: [\n {\n group: 'external',\n pattern: '@prairielearn/**',\n position: 'after',\n },\n ],\n\n pathGroupsExcludedImportTypes: ['builtin'],\n },\n ],\n },\n\n settings: {\n 'import-x/parsers': {\n '@typescript-eslint/parser': ['.ts', '.js'],\n },\n 'import-x/resolver': {\n node: true,\n typescript: true,\n },\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsdoc.js","sourceRoot":"","sources":["../../src/configs/jsdoc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAExC;;GAEG;AACH,MAAM,UAAU,WAAW
|
|
1
|
+
{"version":3,"file":"jsdoc.js","sourceRoot":"","sources":["../../src/configs/jsdoc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAExC;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO;QACL;YACE,OAAO,EAAE;gBACP,KAAK;aACN;YAED,QAAQ,EAAE;gBACR,KAAK,EAAE;oBACL,QAAQ,EAAE;wBACR,6EAA6E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AK;gBAC9B,iBAAiB,EAAE,KAAK;aACzB;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport jsdoc from 'eslint-plugin-jsdoc';\n\n/**\n * JSDoc documentation rules.\n */\nexport function jsdocConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n jsdoc,\n },\n\n settings: {\n jsdoc: {\n contexts: [\n // We don't want to require documentation of a 'locals' (res.locals) variable\n // AST Parser: https://github.com/es-joy/jsdoccomment\n {\n comment: 'JsdocBlock:not(:has(JsdocTag[tag=\"param\"][name=\"locals\"]))',\n context: 'FunctionDeclaration',\n },\n {\n comment: 'JsdocBlock:not(:has(JsdocTag[tag=\"param\"][name=\"locals\"]))',\n context: 'FunctionExpression',\n },\n 'ArrowFunctionExpression',\n 'TSDeclareFunction',\n ],\n exemptDestructuredRootsFromChecks: true,\n },\n },\n },\n // TypeScript files\n {\n files: ['**/*.{ts,tsx}'],\n rules: {\n ...jsdoc.configs['flat/recommended-typescript-error'].rules,\n 'jsdoc/check-line-alignment': 'error',\n 'jsdoc/check-tag-names': ['error', { definedTags: ['knipignore'] }],\n 'jsdoc/convert-to-jsdoc-comments': [\n 'error',\n {\n allowedPrefixes: ['@ts-', 'istanbul ', 'c8 ', 'v8 ', 'eslint', 'prettier-', 'global'],\n contexts: ['FunctionDeclaration', 'TSDeclareFunction'],\n contextsBeforeAndAfter: ['TSPropertySignature'],\n enforceJsdocLineStyle: 'single',\n },\n ],\n 'jsdoc/require-asterisk-prefix': 'error',\n 'jsdoc/require-jsdoc': 'off',\n 'jsdoc/require-param': 'off',\n 'jsdoc/require-returns': 'off',\n 'jsdoc/tag-lines': 'off',\n },\n },\n // JavaScript files\n {\n files: ['**/*.js'],\n rules: {\n ...jsdoc.configs['flat/recommended-typescript-flavor-error'].rules,\n 'jsdoc/check-line-alignment': 'error',\n 'jsdoc/require-asterisk-prefix': 'error',\n 'jsdoc/require-jsdoc': 'off',\n 'jsdoc/require-param': 'off',\n 'jsdoc/require-param-description': 'off',\n 'jsdoc/require-returns': 'off',\n 'jsdoc/tag-lines': 'off',\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lodash.js","sourceRoot":"","sources":["../../src/configs/lodash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,2BAA2B,MAAM,+CAA+C,CAAC;AAExF,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;AAEhC;;GAEG;AACH,MAAM,UAAU,YAAY
|
|
1
|
+
{"version":3,"file":"lodash.js","sourceRoot":"","sources":["../../src/configs/lodash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,2BAA2B,MAAM,+CAA+C,CAAC;AAExF,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;AAEhC;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL;YACE,OAAO,EAAE;gBACP,iCAAiC,EAAE,2BAA2B;aAC/D;SACF;QACD,6CAA6C;QAC7C,GAAG,MAAM,CAAC,OAAO,CAAC,4CAA4C,CAAC;QAC/D;YACE,KAAK,EAAE;gBACL,wDAAwD;gBACxD,sCAAsC,EAAE,KAAK;aAC9C;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { FlatCompat } from '@eslint/eslintrc';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport youDontNeedLodashUnderscore from 'eslint-plugin-you-dont-need-lodash-underscore';\n\nconst compat = new FlatCompat();\n\n/**\n * Lodash/underscore replacement rules.\n */\nexport function lodashConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n 'you-dont-need-lodash-underscore': youDontNeedLodashUnderscore,\n },\n },\n // Use FlatCompat to extend the legacy config\n ...compat.extends('plugin:you-dont-need-lodash-underscore/all'),\n {\n rules: {\n // The _.omit function is still useful in some contexts.\n 'you-dont-need-lodash-underscore/omit': 'off',\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perfectionist.js","sourceRoot":"","sources":["../../src/configs/perfectionist.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB
|
|
1
|
+
{"version":3,"file":"perfectionist.js","sourceRoot":"","sources":["../../src/configs/perfectionist.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL;YACE,OAAO,EAAE;gBACP,aAAa;aACd;YAED,KAAK,EAAE;gBACL,iFAAiF;gBACjF,GAAG,MAAM,CAAC,WAAW,CACnB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;oBACvD,gBAAgB,GAAG,QAAQ;oBAC3B;wBACE,8EAA8E;wBAC9E,KAAK;wBACL,6CAA6C;wBAC7C,CAAC,uBAAuB,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;4BAChF,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;4BACrB,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;qBAClD;iBACF,CAAC,CACH;gBAED,+CAA+C;gBAC/C,8BAA8B,EAAE;oBAC9B,OAAO;oBACP;wBACE,YAAY,EAAE;4BACZ,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;4BACzD,EAAE,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE;yBAC7D;wBACD,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,CAAC;wBAC7D,UAAU,EAAE,IAAI;wBAChB,IAAI,EAAE,UAAU;qBACjB;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport perfectionist from 'eslint-plugin-perfectionist';\n\n/**\n * Perfectionist sorting rules.\n * Most rules are off by default but pre-configured for convenient inline enabling.\n * `sort-jsx-props` is enabled by default with callback grouping.\n */\nexport function perfectionistConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n perfectionist,\n },\n\n rules: {\n // Configure all perfectionist rules to be off by default but with options preset\n ...Object.fromEntries(\n Object.keys(perfectionist.rules ?? {}).map((ruleName) => [\n 'perfectionist/' + ruleName,\n [\n // Configure the options for every rule, to make inline usage more convenient.\n 'off',\n // These rules don't have a comment partition\n ['sort-heritage-clauses', 'sort-jsx-props', 'sort-switch-case'].includes(ruleName)\n ? { type: 'natural' }\n : { partitionByComment: true, type: 'natural' },\n ],\n ]),\n ),\n\n // Enable sort-jsx-props with callback grouping\n 'perfectionist/sort-jsx-props': [\n 'error',\n {\n customGroups: [\n { elementNamePattern: '^on[A-Z]', groupName: 'callback' },\n { elementNamePattern: '^(key|ref)$', groupName: 'reserved' },\n ],\n groups: ['reserved', 'unknown', 'shorthand-prop', 'callback'],\n ignoreCase: true,\n type: 'unsorted',\n },\n ],\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prairielearn.js","sourceRoot":"","sources":["../../src/configs/prairielearn.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,6BAA6B,CAAC;AASvD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAmC
|
|
1
|
+
{"version":3,"file":"prairielearn.js","sourceRoot":"","sources":["../../src/configs/prairielearn.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,6BAA6B,CAAC;AASvD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAmC;IAEnC,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAE5C,OAAO;QACL;YACE,OAAO,EAAE;gBACP,eAAe,EAAE,YAAY;aAC9B;YAED,KAAK,EAAE;gBACL,2CAA2C,EAAE,OAAO;gBACpD,wCAAwC,EAAE,OAAO;gBACjD,2CAA2C,EAAE,OAAO;gBACpD,6CAA6C,EAAE,OAAO;gBACtD,oCAAoC,EAAE,OAAO;gBAC7C,6BAA6B,EAAE;oBAC7B,OAAO;oBACP;wBACE,YAAY;qBACb;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\n\nimport prairielearn from '@prairielearn/eslint-plugin';\n\nexport interface PrairieLearnPluginOptions {\n /**\n * Types to allow when using the safe-db-types rule.\n */\n allowDbTypes?: string[];\n}\n\n/**\n * PrairieLearn-specific ESLint plugin rules.\n * Includes AWS client configuration, JSX safety, SQL blocks, and database type safety.\n */\nexport function prairieLearnConfig(\n options?: PrairieLearnPluginOptions,\n): TSESLint.FlatConfig.ConfigArray {\n const { allowDbTypes = [] } = options ?? {};\n\n return [\n {\n plugins: {\n '@prairielearn': prairielearn,\n },\n\n rules: {\n '@prairielearn/aws-client-mandatory-config': 'error',\n '@prairielearn/aws-client-shared-config': 'error',\n '@prairielearn/jsx-no-dollar-interpolation': 'error',\n '@prairielearn/no-current-target-in-callback': 'error',\n '@prairielearn/no-unused-sql-blocks': 'error',\n '@prairielearn/safe-db-types': [\n 'error',\n {\n allowDbTypes,\n },\n ],\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/configs/react.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAEtD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,UAAU,MAAM,2BAA2B,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K,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO;iBACrC,CACF,CACF;gBACD,uEAAuE;gBACvE,2EAA2E;gBAC3E,2CAA2C,EAAE,KAAK;gBAClD,6BAA6B;gBAC7B,kCAAkC,EAAE,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;gBAElE,wBAAwB;gBACxB,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;gBAChC,kCAAkC,EAAE,OAAO;gBAC3C,iBAAiB,EAAE,OAAO;gBAC1B,wCAAwC,EAAE,OAAO;gBACjD,2DAA2D;gBAC3D,0DAA0D,EAAE;oBAC1D,OAAO;oBACP;wBACE,EAAE,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;wBACpD,EAAE,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC;wBAC/E,KAAK,EAAE,CAAC,MAAM,CAAC;wBACf,EAAE,EAAE,CAAC,UAAU,CAAC;wBAChB,EAAE,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC;qBACxF;iBACF;aACF;YAED,QAAQ,EAAE;gBACR,YAAY,EAAE;oBACZ,UAAU,EAAE;wBACV,GAAG,EAAE,CAAC,SAAS,CAAC;qBACjB;iBACF;gBACD,GAAG,iBAAiB,CAAC,QAAQ;aAC9B;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import eslintReact from '@eslint-react/eslint-plugin';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport jsxA11yX from 'eslint-plugin-jsx-a11y-x';\nimport reactHooks from 'eslint-plugin-react-hooks';\nimport reactYouMightNotNeedAnEffect from 'eslint-plugin-react-you-might-not-need-an-effect';\n\n// The eslint-react config has plugins/settings/rules but the type doesn't expose them all\nconst eslintReactConfig = eslintReact.configs['recommended-typescript'] as {\n plugins?: TSESLint.FlatConfig.Plugins;\n rules?: TSESLint.FlatConfig.Rules;\n settings?: TSESLint.FlatConfig.Settings;\n};\n\n/**\n * React, React hooks, accessibility, and related rules.\n */\nexport function reactConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n 'jsx-a11y-x': jsxA11yX,\n 'react-hooks': reactHooks,\n 'react-you-might-not-need-an-effect': reactYouMightNotNeedAnEffect,\n ...eslintReactConfig.plugins,\n },\n\n rules: {\n // React hooks\n 'react-hooks/exhaustive-deps': 'error',\n 'react-hooks/rules-of-hooks': 'error',\n\n // react-you-might-not-need-an-effect rules as errors\n ...Object.fromEntries(\n Object.keys(reactYouMightNotNeedAnEffect.configs?.recommended?.rules ?? {}).map(\n (ruleName: string) => [ruleName, 'error'],\n ),\n ),\n\n // eslint-react recommended rules as errors\n ...Object.fromEntries(\n Object.entries(eslintReactConfig.rules ?? {}).map(\n ([ruleName, severity]: [string, unknown]) => [\n ruleName,\n severity === 'off' ? 'off' : 'error',\n ],\n ),\n ),\n // We want to be able to use `useState` without the setter function for\n // https://tkdodo.eu/blog/react-query-fa-qs#2-the-queryclient-is-not-stable\n '@eslint-react/naming-convention/use-state': 'off',\n // Forbid `snake_case` props.\n '@eslint-react/no-forbidden-props': ['error', { forbid: ['/_/'] }],\n\n // jsx-a11y strict rules\n ...jsxA11yX.configs.strict.rules,\n 'jsx-a11y-x/anchor-ambiguous-text': 'error',\n 'jsx-a11y-x/lang': 'error',\n 'jsx-a11y-x/no-aria-hidden-on-focusable': 'error',\n // Bootstrap turns some elements into interactive elements.\n 'jsx-a11y-x/no-noninteractive-element-to-interactive-role': [\n 'error',\n {\n li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],\n ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],\n table: ['grid'],\n td: ['gridcell'],\n ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid', 'role'],\n },\n ],\n },\n\n settings: {\n 'jsx-a11y-x': {\n attributes: {\n for: ['htmlFor'],\n },\n },\n ...eslintReactConfig.settings,\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylistic.js","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAGjD;;GAEG;AACH,MAAM,UAAU,eAAe
|
|
1
|
+
{"version":3,"file":"stylistic.js","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAGjD;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO;QACL;YACE,OAAO,EAAE;gBACP,YAAY,EAAE,SAAS;aACxB;YAED,KAAK,EAAE;gBACL,qCAAqC,EAAE;oBACrC,OAAO;oBACP,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;iBACnE;gBAED,kCAAkC,EAAE;oBAClC,OAAO;oBACP;wBACE,SAAS,EAAE,IAAI;wBACf,IAAI,EAAE,IAAI;qBACX;iBACF;gBACD,4BAA4B,EAAE;oBAC5B,OAAO;oBACP;wBACE,YAAY,EAAE,OAAO;wBACrB,aAAa,EAAE,OAAO;wBACtB,iBAAiB,EAAE,QAAQ;wBAC3B,YAAY,EAAE,OAAO;qBACtB;iBACF;gBACD,wCAAwC,EAAE;oBACxC,OAAO;oBACP,QAAQ;oBACR,EAAE,qBAAqB,EAAE,IAAI,EAAE;iBAChC;gBACD,oBAAoB,EAAE,OAAO;gBAC7B,4CAA4C,EAAE;oBAC5C,OAAO;oBACP,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE;oBACpD,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAClD,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;iBACrD;gBACD,uEAAuE;gBACvE,0EAA0E;gBAC1E,mBAAmB,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;aAChE;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import stylistic from '@stylistic/eslint-plugin';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\n/**\n * Stylistic formatting rules.\n */\nexport function stylisticConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n '@stylistic': stylistic,\n },\n\n rules: {\n '@stylistic/jsx-curly-brace-presence': [\n 'error',\n { children: 'never', propElementValues: 'always', props: 'never' },\n ],\n\n '@stylistic/jsx-self-closing-comp': [\n 'error',\n {\n component: true,\n html: true,\n },\n ],\n '@stylistic/jsx-tag-spacing': [\n 'error',\n {\n afterOpening: 'never',\n beforeClosing: 'allow',\n beforeSelfClosing: 'always',\n closingSlash: 'never',\n },\n ],\n '@stylistic/lines-between-class-members': [\n 'error',\n 'always',\n { exceptAfterSingleLine: true },\n ],\n '@stylistic/no-tabs': 'error',\n '@stylistic/padding-line-between-statements': [\n 'error',\n { blankLine: 'always', next: 'function', prev: '*' },\n { blankLine: 'always', next: '*', prev: 'import' },\n { blankLine: 'any', next: 'import', prev: 'import' },\n ],\n // Blocks double-quote strings (unless a single quote is present in the\n // string) and backticks (unless there is a tag or substitution in place).\n '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack.js","sourceRoot":"","sources":["../../src/configs/tanstack.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAGxD;;GAEG;AACH,MAAM,UAAU,cAAc
|
|
1
|
+
{"version":3,"file":"tanstack.js","sourceRoot":"","sources":["../../src/configs/tanstack.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAGxD;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL;YACE,OAAO,EAAE;gBACP,iBAAiB,EAAE,WAAW;aAC/B;YAED,KAAK,EAAE;gBACL,gIAAgI;gBAChI,GAAG,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;gBACnD,uCAAuC,EAAE,OAAO;aACjD;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import pluginQuery from '@tanstack/eslint-plugin-query';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\n/**\n * TanStack Query (React Query) rules.\n */\nexport function tanstackConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n '@tanstack/query': pluginQuery,\n },\n\n rules: {\n // https://github.com/TanStack/query/blob/6402d756b702ac560b69a5ce84d6e4e764b96451/packages/eslint-plugin-query/src/index.ts#L43\n ...pluginQuery.configs['flat/recommended'][0].rules,\n '@tanstack/query/no-rest-destructuring': 'error',\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,gBAAgB
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL;YACE,KAAK,EAAE;gBACL,4CAA4C,EAAE;oBAC5C,OAAO;oBACP,EAAE,QAAQ,EAAE,qBAAqB,EAAE;iBACpC;gBACD,4EAA4E;gBAC5E,sCAAsC,EAAE,KAAK;gBAC7C,6CAA6C;gBAC7C,oCAAo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E,IAAI;gBACtB,oBAAoB,EAAE,IAAI;aAC3B;SACF;QACD,8CAA8C,EAAE,KAAK;QACrD,iDAAiD,EAAE,KAAK;QACxD,uCAAuC,EAAE,KAAK;QAC9C,kDAAkD,EAAE;YAClD,OAAO;YACP;gBACE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC;gBACnE,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI;gBAClB,YAAY,EAAE,IAAI;gBAClB,WAAW,EAAE,IAAI;gBACjB,WAAW,EAAE,IAAI;aAClB;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\n\n/**\n * TypeScript-specific rules (non-type-aware).\n */\nexport function typescriptConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n rules: {\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n { fixStyle: 'inline-type-imports' },\n ],\n // We use empty functions in quite a few places, so we'll disable this rule.\n '@typescript-eslint/no-empty-function': 'off',\n // Look, sometimes we just want to use `any`.\n '@typescript-eslint/no-explicit-any': 'off',\n // This was enabled when we upgraded to `@typescript-eslint/*` v6.\n '@typescript-eslint/no-dynamic-delete': 'off',\n // We use `!` to assert that a value is not `null` or `undefined`.\n '@typescript-eslint/no-non-null-assertion': 'off',\n // Replaces the standard `no-unused-vars` rule.\n '@typescript-eslint/no-unused-vars': [\n 'error',\n {\n args: 'after-used',\n argsIgnorePattern: '^_', // Args can be _\n varsIgnorePattern: '^_.', // This includes lodash, which should be considered\n },\n ],\n },\n },\n ];\n}\n\n/**\n * Type-aware TypeScript rules.\n * These require a tsconfig.json to be configured.\n */\nexport function typescriptTypeAwareRules(): TSESLint.FlatConfig.Rules {\n return {\n '@typescript-eslint/no-base-to-string': 'off',\n '@typescript-eslint/no-invalid-void-type': [\n 'error',\n {\n allowAsThisParameter: true,\n },\n ],\n '@typescript-eslint/no-unsafe-argument': 'off',\n '@typescript-eslint/no-unsafe-assignment': 'off',\n '@typescript-eslint/no-unsafe-call': 'off',\n '@typescript-eslint/no-unsafe-member-access': 'off',\n '@typescript-eslint/no-unsafe-return': 'off',\n // Some functions are required to be async, but don't actually use any async code.\n '@typescript-eslint/require-await': 'off',\n // We don't always check that we got a error when a promise is rejected.\n '@typescript-eslint/no-misused-promises': [\n 'error',\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n // Common usage with `async` functions\n arguments: false,\n // Common usage with `async` onClick handlers\n attributes: false,\n inheritedMethods: true,\n // Common usage with e.g. setState\n properties: false,\n returns: true,\n variables: true,\n },\n },\n ],\n '@typescript-eslint/no-unnecessary-condition': [\n 'error',\n { allowConstantLoopConditions: 'only-allowed-literals' },\n ],\n '@typescript-eslint/only-throw-error': [\n 'error',\n {\n allow: [\n {\n from: 'file',\n name: 'HttpRedirect',\n },\n ],\n allowRethrowing: true,\n allowThrowingAny: true,\n allowThrowingUnknown: true,\n },\n ],\n '@typescript-eslint/prefer-nullish-coalescing': 'off',\n '@typescript-eslint/prefer-promise-reject-errors': 'off',\n '@typescript-eslint/prefer-regexp-exec': 'off',\n '@typescript-eslint/restrict-template-expressions': [\n 'error',\n {\n allow: [{ from: 'lib', name: ['Error', 'URL', 'URLSearchParams'] }],\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumber: true,\n allowRegExp: true,\n },\n ],\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unicorn.js","sourceRoot":"","sources":["../../src/configs/unicorn.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,aAAa
|
|
1
|
+
{"version":3,"file":"unicorn.js","sourceRoot":"","sources":["../../src/configs/unicorn.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD;;GAEG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2B,EAAE,KAAK;gBAClC,qCAAqC,EAAE,KAAK;gBAC5C,qBAAqB,EAAE,KAAK;gBAC5B,sBAAsB,EAAE,KAAK;gBAC7B,kCAAkC,EAAE,KAAK;gBACzC,+BAA+B,EAAE,KAAK;gBACtC,uBAAuB,EAAE,KAAK;gBAC9B,uBAAuB,EAAE,KAAK;gBAC9B,uCAAuC,EAAE,KAAK;gBAE9C,mDAAmD;gBACnD,wCAAwC,EAAE,KAAK;gBAC/C,mCAAmC,EAAE,KAAK;gBAC1C,sCAAsC,EAAE,KAAK;gBAC7C,6BAA6B,EAAE,KAAK;gBAEpC,kBAAkB;gBAClB,uBAAuB,EAAE,KAAK;gBAC9B,mBAAmB,EAAE,KAAK,EAAE,+EAA+E;gBAC3G,yBAAyB,EAAE,KAAK;gBAEhC,mCAAmC;gBACnC,8BAA8B,EAAE,KAAK;gBACrC,4BAA4B,EAAE,KAAK;gBACnC,uBAAuB,EAAE,KAAK;gBAE9B,4EAA4E;gBAC5E,qBAAqB,EAAE,KAAK;gBAE5B,0BAA0B;gBAC1B,2BAA2B,EAAE,KAAK;gBAClC,6BAA6B,EAAE,KAAK;gBACpC,yBAAyB,EAAE,KAAK;aACjC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport eslintPluginUnicorn from 'eslint-plugin-unicorn';\n\n/**\n * Unicorn plugin rules with PrairieLearn-specific overrides.\n */\nexport function unicornConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n unicorn: eslintPluginUnicorn,\n },\n\n rules: {\n ...eslintPluginUnicorn.configs.recommended.rules,\n\n // These rules don't align with our own style guidelines\n 'unicorn/filename-case': 'off', // We don't enforce specific styles for filenames\n 'unicorn/no-anonymous-default-export': 'off', // We use this for all of our pages\n 'unicorn/no-array-callback-reference': 'off',\n 'unicorn/no-array-method-this-argument': 'off',\n 'unicorn/no-array-reduce': 'off', // Sometimes, an array reduce is more readable\n 'unicorn/no-array-reverse': 'off', // `Array.prototype.toReversed` is not yet supported by our TypeScript config\n 'unicorn/no-array-sort': 'off', // Disabling for the time being to avoid unnecessary diffs\n 'unicorn/no-hex-escape': 'off',\n 'unicorn/no-lonely-if': 'off', // https://github.com/PrairieLearn/PrairieLearn/pull/12546#discussion_r2252261293\n 'unicorn/no-null': 'off',\n 'unicorn/no-useless-undefined': 'off', // Explicit undefined is more readable than implicit undefined\n 'unicorn/prefer-code-point': 'off',\n 'unicorn/prefer-dom-node-dataset': 'off', // https://github.com/PrairieLearn/PrairieLearn/pull/12546#discussion_r2261095992\n 'unicorn/prefer-export-from': 'off', // https://github.com/PrairieLearn/PrairieLearn/pull/12546#discussion_r2252265000\n 'unicorn/prefer-string-raw': 'off', // We don't use `String.raw` in our codebase\n 'unicorn/prefer-ternary': 'off', // if/else can be more readable than a ternary\n 'unicorn/prefer-top-level-await': 'off', // we use this on a lot of pages\n 'unicorn/prefer-type-error': 'off',\n 'unicorn/prevent-abbreviations': 'off',\n\n // These rules have many violations. Decisions about enabling the rules have been deferred.\n 'unicorn/catch-error-name': 'off', // 200+ violations\n 'unicorn/no-array-for-each': 'off', // 300+ violations\n 'unicorn/no-await-expression-member': 'off', // 400+ violations\n 'unicorn/no-negated-condition': 'off', // 150+ violations\n 'unicorn/prefer-global-this': 'off', // 150+ violations\n 'unicorn/prefer-node-protocol': 'off', // 100+ violations\n 'unicorn/switch-case-braces': 'off', // 200+ violations\n\n // TODO: investigate, < 100 violations\n 'unicorn/consistent-assert': 'off',\n 'unicorn/consistent-function-scoping': 'off',\n 'unicorn/escape-case': 'off',\n 'unicorn/import-style': 'off',\n 'unicorn/numeric-separators-style': 'off',\n 'unicorn/prefer-query-selector': 'off',\n 'unicorn/prefer-spread': 'off',\n 'unicorn/prefer-switch': 'off',\n 'unicorn/text-encoding-identifier-case': 'off',\n\n // TODO: investigated and manual fixes are required\n 'unicorn/no-object-as-default-parameter': 'off',\n 'unicorn/prefer-add-event-listener': 'off',\n 'unicorn/prefer-dom-node-text-content': 'off',\n 'unicorn/prefer-event-target': 'off',\n\n // False positives\n 'unicorn/error-message': 'off',\n 'unicorn/prefer-at': 'off', // https://github.com/microsoft/TypeScript/issues/47660#issuecomment-3146907649\n 'unicorn/throw-new-error': 'off',\n\n // Duplicated from other lint rules\n 'unicorn/no-static-only-class': 'off',\n 'unicorn/no-this-assignment': 'off',\n 'unicorn/prefer-module': 'off',\n\n // https://github.com/PrairieLearn/PrairieLearn/pull/12545/files#r2252069292\n 'unicorn/no-for-loop': 'off',\n\n // Conflicts with prettier\n 'unicorn/no-nested-ternary': 'off',\n 'unicorn/number-literal-case': 'off',\n 'unicorn/template-indent': 'off',\n },\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.js","sourceRoot":"","sources":["../../src/configs/vitest.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C;;GAEG;AACH,MAAM,UAAU,YAAY
|
|
1
|
+
{"version":3,"file":"vitest.js","sourceRoot":"","sources":["../../src/configs/vitest.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL;YACE,OAAO,EAAE;gBACP,MAAM;aACP;YAED,KAAK,EAAE;gBACL,uCAAuC;gBACvC,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;gBAEnC,0CAA0C;gBAC1C,0BAA0B,EAAE,KAAK;gBAEjC,sEAAsE;gBACtE,qEAAqE;gBACrE,mDAAmD;gBACnD,sBAAsB,EAAE,KAAK;gBAE7B,sEAAsE;gBACtE,2BAA2B,EAAE,KAAK;aACnC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport vitest from '@vitest/eslint-plugin';\n\n/**\n * Vitest test framework rules.\n */\nexport function vitestConfig(): TSESLint.FlatConfig.ConfigArray {\n return [\n {\n plugins: {\n vitest,\n },\n\n rules: {\n // Use the recommended rules for vitest\n ...vitest.configs.recommended.rules,\n\n // We are disabling the test for a reason.\n 'vitest/no-disabled-tests': 'off',\n\n // This gives a lot of false positives; we sometimes author tests that\n // have the assertion in a helper function. We could refactor them in\n // the future, but for now we'll disable this rule.\n 'vitest/expect-expect': 'off',\n\n // We violate this rule in a lot of places. We'll turn it off for now.\n 'vitest/no-identical-title': 'off',\n },\n },\n ];\n}\n"]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAkC,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAqDnD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAwC
|
|
1
|
+
{"version":3,"file":"index.js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","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport { globalIgnores } from 'eslint/config';\nimport tseslint from 'typescript-eslint';\n\nimport { baseConfig } from './configs/base.js';\nimport { importsConfig } from './configs/imports.js';\nimport { jsdocConfig } from './configs/jsdoc.js';\nimport { lodashConfig } from './configs/lodash.js';\nimport { perfectionistConfig } from './configs/perfectionist.js';\nimport { type PrairieLearnPluginOptions, prairieLearnConfig } from './configs/prairielearn.js';\nimport { reactConfig } from './configs/react.js';\nimport { stylisticConfig } from './configs/stylistic.js';\nimport { tanstackConfig } from './configs/tanstack.js';\nimport { typescriptConfig, typescriptTypeAwareRules } from './configs/typescript.js';\nimport { unicornConfig } from './configs/unicorn.js';\nimport { vitestConfig } from './configs/vitest.js';\n\nexport interface PrairieLearnEslintConfigOptions {\n /**\n * Root directory for TypeScript project service.\n * Required for type-aware linting.\n */\n tsconfigRootDir: string;\n\n /**\n * Glob patterns for files to apply type-aware rules to.\n * @default ['**\\/*.{ts,tsx}']\n */\n typeAwareFiles?: string[];\n\n /**\n * Files to allow in defaultProject for type-aware linting.\n * Useful for config files outside the main tsconfig.\n * @default ['*.config.ts', '*.config.mts', 'vitest.config.ts']\n */\n allowDefaultProject?: string[];\n\n /**\n * Enable `@prairielearn/eslint-plugin` rules.\n * @default true\n */\n prairielearn?: boolean;\n\n /**\n * Options for the `@prairielearn/eslint-plugin` rules.\n */\n prairieLearnOptions?: PrairieLearnPluginOptions;\n\n /**\n * Global ignores to apply.\n * Will be merged with default ignores.\n */\n ignores?: string[];\n\n /**\n * Disable specific config modules.\n */\n disable?: {\n react?: boolean;\n vitest?: boolean;\n perfectionist?: boolean;\n unicorn?: boolean;\n jsdoc?: boolean;\n tanstack?: boolean;\n lodash?: boolean;\n };\n}\n\n/**\n * Creates a PrairieLearn ESLint configuration array.\n *\n * @example\n * ```js\n * // eslint.config.mjs\n * import { prairielearn } from '@prairielearn/eslint-config';\n *\n * export default [\n * ...prairielearn({\n * tsconfigRootDir: import.meta.dirname,\n * }),\n * // Add your project-specific rules here\n * ];\n * ```\n */\nexport function prairielearn(\n options: PrairieLearnEslintConfigOptions,\n): TSESLint.FlatConfig.ConfigArray {\n const {\n tsconfigRootDir,\n typeAwareFiles = ['**/*.{ts,tsx}'],\n allowDefaultProject = ['*.config.ts', '*.config.mts', 'vitest.config.ts'],\n prairielearn: enablePrairielearn = true,\n prairieLearnOptions,\n ignores = [],\n disable = {},\n } = options;\n\n const jsFiles = ['**/*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}'];\n\n const configs: TSESLint.FlatConfig.ConfigArray = [\n // Base typescript-eslint configs (scoped to JS/TS files)\n ...tseslint.config({\n extends: [...tseslint.configs.stylistic, ...tseslint.configs.strict],\n files: jsFiles,\n }),\n // Base configs (always included)\n ...baseConfig(),\n // TypeScript config (scoped to JS/TS files)\n {\n files: jsFiles,\n ...typescriptConfig()[0],\n },\n ...importsConfig(),\n ...stylisticConfig(),\n ];\n\n // Optional configs\n if (!disable.react) {\n configs.push(...reactConfig());\n }\n\n if (!disable.vitest) {\n configs.push(...vitestConfig());\n }\n\n if (!disable.perfectionist) {\n configs.push(...perfectionistConfig());\n }\n\n if (!disable.unicorn) {\n configs.push(...unicornConfig());\n }\n\n if (!disable.jsdoc) {\n configs.push(...jsdocConfig());\n }\n\n if (!disable.tanstack) {\n configs.push(...tanstackConfig());\n }\n\n if (!disable.lodash) {\n configs.push(...lodashConfig());\n }\n\n if (enablePrairielearn) {\n configs.push(...prairieLearnConfig(prairieLearnOptions));\n }\n\n // Type-aware rules (applied to specified files)\n // We use tseslint.config() to properly handle the extends syntax\n configs.push(\n ...tseslint.config({\n extends: [\n tseslint.configs.recommendedTypeCheckedOnly,\n tseslint.configs.stylisticTypeCheckedOnly,\n ],\n files: typeAwareFiles,\n languageOptions: {\n parserOptions: {\n projectService: {\n allowDefaultProject,\n },\n tsconfigRootDir,\n },\n },\n rules: typescriptTypeAwareRules(),\n }),\n );\n\n // Default ignores\n return [\n ...configs,\n globalIgnores(['.yarn/*', 'node_modules/*', 'dist/*', 'coverage/*', ...ignores]),\n ];\n}\n\n// Re-export individual configs for advanced use\nexport { baseConfig } from './configs/base.js';\nexport { importsConfig } from './configs/imports.js';\nexport { jsdocConfig } from './configs/jsdoc.js';\nexport { lodashConfig } from './configs/lodash.js';\nexport { perfectionistConfig } from './configs/perfectionist.js';\nexport { prairieLearnConfig, type PrairieLearnPluginOptions } from './configs/prairielearn.js';\nexport { reactConfig } from './configs/react.js';\nexport { stylisticConfig } from './configs/stylistic.js';\nexport { tanstackConfig } from './configs/tanstack.js';\nexport { typescriptConfig, typescriptTypeAwareRules } from './configs/typescript.js';\nexport { unicornConfig } from './configs/unicorn.js';\nexport { vitestConfig } from './configs/vitest.js';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prairielearn/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,34 +19,34 @@
|
|
|
19
19
|
"dev": "tsgo --watch --preserveWatchOutput"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"eslint": "^
|
|
22
|
+
"eslint": "^10.0.0",
|
|
23
23
|
"typescript": "^5.0.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@eslint-react/eslint-plugin": "^2.
|
|
27
|
-
"@eslint/eslintrc": "^3.
|
|
28
|
-
"@eslint/js": "^
|
|
29
|
-
"@prairielearn/eslint-plugin": "^
|
|
30
|
-
"@stylistic/eslint-plugin": "^5.
|
|
31
|
-
"@tanstack/eslint-plugin-query": "^5.91.
|
|
32
|
-
"@typescript-eslint/utils": "^8.
|
|
33
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
26
|
+
"@eslint-react/eslint-plugin": "^2.13.0",
|
|
27
|
+
"@eslint/eslintrc": "^3.3.4",
|
|
28
|
+
"@eslint/js": "^10.0.1",
|
|
29
|
+
"@prairielearn/eslint-plugin": "^4.0.0",
|
|
30
|
+
"@stylistic/eslint-plugin": "^5.9.0",
|
|
31
|
+
"@tanstack/eslint-plugin-query": "^5.91.4",
|
|
32
|
+
"@typescript-eslint/utils": "^8.56.1",
|
|
33
|
+
"@vitest/eslint-plugin": "^1.6.9",
|
|
34
34
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
35
35
|
"eslint-plugin-import-x": "^4.16.1",
|
|
36
|
-
"eslint-plugin-jsdoc": "^62.
|
|
36
|
+
"eslint-plugin-jsdoc": "^62.7.1",
|
|
37
37
|
"eslint-plugin-jsx-a11y-x": "^0.1.1",
|
|
38
38
|
"eslint-plugin-no-floating-promise": "^2.0.0",
|
|
39
|
-
"eslint-plugin-perfectionist": "^5.
|
|
39
|
+
"eslint-plugin-perfectionist": "^5.6.0",
|
|
40
40
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
41
|
-
"eslint-plugin-react-you-might-not-need-an-effect": "^0.
|
|
42
|
-
"eslint-plugin-unicorn": "^
|
|
41
|
+
"eslint-plugin-react-you-might-not-need-an-effect": "^0.9.2",
|
|
42
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
43
43
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
|
|
44
|
-
"globals": "^
|
|
45
|
-
"typescript-eslint": "^8.
|
|
44
|
+
"globals": "^17.4.0",
|
|
45
|
+
"typescript-eslint": "^8.56.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@prairielearn/tsconfig": "^2.0.0",
|
|
49
|
-
"@types/node": "^24.
|
|
50
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
49
|
+
"@types/node": "^24.11.0",
|
|
50
|
+
"@typescript/native-preview": "^7.0.0-dev.20260305.1"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/src/configs/base.ts
CHANGED
|
@@ -102,7 +102,7 @@ export function baseConfig(): TSESLint.FlatConfig.ConfigArray {
|
|
|
102
102
|
'prefer-named-capture-group': 'off',
|
|
103
103
|
'prefer-object-has-own': 'off',
|
|
104
104
|
'prefer-template': 'off',
|
|
105
|
-
radix: ['
|
|
105
|
+
radix: ['off'], // We should never rely on this for parsing non-decimal numbers.
|
|
106
106
|
'require-atomic-updates': 'off',
|
|
107
107
|
'require-await': 'off',
|
|
108
108
|
'require-unicode-regexp': 'off',
|