@prairielearn/eslint-config 1.0.0 → 2.0.0
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 +27 -0
- package/dist/configs/base.d.ts.map +1 -1
- package/dist/configs/base.js +2 -2
- package/dist/configs/base.js.map +1 -1
- package/dist/configs/jsdoc.d.ts.map +1 -1
- package/dist/configs/jsdoc.js +1 -1
- package/dist/configs/jsdoc.js.map +1 -1
- package/package.json +18 -18
- package/src/configs/base.ts +2 -2
- package/src/configs/jsdoc.ts +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @prairielearn/eslint-config
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 3c4799a: Upgrade to ESLint v10
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 3c4799a: Upgrade all JavaScript dependencies
|
|
12
|
+
- 3c4799a: Disable the radix rule
|
|
13
|
+
- Updated dependencies [3c4799a]
|
|
14
|
+
- Updated dependencies [3c4799a]
|
|
15
|
+
- @prairielearn/eslint-plugin@4.0.0
|
|
16
|
+
|
|
17
|
+
## 1.1.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- a3ba8a0: Add `max-params` rule with a maximum of 6 parameters per function
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 7b937fb: Remove unused exports, add `@knipignore` for intentionally public exports, and re-export newly used symbols from `@prairielearn/formatter`.
|
|
26
|
+
- Updated dependencies [7b937fb]
|
|
27
|
+
- @prairielearn/eslint-plugin@3.1.1
|
|
@@ -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': '
|
|
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
|
@@ -42,7 +42,7 @@ export function baseConfig() {
|
|
|
42
42
|
'max-depth': 'off',
|
|
43
43
|
'max-lines': 'off',
|
|
44
44
|
'max-lines-per-function': 'off',
|
|
45
|
-
'max-params': '
|
|
45
|
+
'max-params': ['error', { max: 6 }],
|
|
46
46
|
'max-statements': 'off',
|
|
47
47
|
'new-cap': 'off',
|
|
48
48
|
'no-await-in-loop': 'off',
|
|
@@ -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;;;GAGG;AACH,MAAM,UAAU,UAAU,GAAoC;IAC5D,OAAO;QACL;YACE,eAAe,EAAE;gBACf,OAAO,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE;aAC7B;YAED,aAAa,EAAE;gBACb,6BAA6B,EAAE,OAAO;aACvC;YAED,OAAO,EAAE;gBACP,qBAAqB,EAAE,iBAAiB;aACzC;YAED,KAAK,EAAE;gBACL,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK;gBACvB,uBAAuB,EAAE,KAAK;gBAC9B,kBAAkB,EAAE,KAAK;gBACzB,SAAS,EAAE,KAAK;gBAChB,sBAAsB,EAAE,KAAK;gBAC7B,wBAAwB,EAAE,KAAK;gBAC/B,UAAU,EAAE,KAAK;gBACjB,mBAAmB,EAAE,KAAK;gBAC1B,iBAAiB,EAAE,KAAK;gBACxB,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC;gBAC5C,cAAc,EAAE,KAAK;gBACrB,cAAc,EAAE,KAAK;gBACrB,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;gBAC1B,YAAY,EAAE,KAAK;gBACnB,YAAY,EAAE,KAAK;gBACnB,cAAc,EAAE,KAAK;gBACrB,qBAAqB,EAAE,OAAO;gBAC9B,WAAW,EAAE,KAAK;gBAClB,mBAAmB,EAAE,KAAK;gBAC1B,8BAA8B,EAAE,KAAK;gBACrC,s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AAK;gBAC7B,uBAAuB,EAAE,KAAK;gBAC9B,mBAAmB,EAAE,KAAK;gBAC1B,wBAAwB,EAAE,KAAK;gBAC/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;AAAA,CACH","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":"jsdoc.d.ts","sourceRoot":"","sources":["../../src/configs/jsdoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,UAAU,CAAC,WAAW,CAiE7D","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',\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
|
+
{"version":3,"file":"jsdoc.d.ts","sourceRoot":"","sources":["../../src/configs/jsdoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,UAAU,CAAC,WAAW,CAiE7D","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"]}
|
package/dist/configs/jsdoc.js
CHANGED
|
@@ -34,7 +34,7 @@ export function jsdocConfig() {
|
|
|
34
34
|
rules: {
|
|
35
35
|
...jsdoc.configs['flat/recommended-typescript-error'].rules,
|
|
36
36
|
'jsdoc/check-line-alignment': 'error',
|
|
37
|
-
'jsdoc/check-tag-names': 'error',
|
|
37
|
+
'jsdoc/check-tag-names': ['error', { definedTags: ['knipignore'] }],
|
|
38
38
|
'jsdoc/convert-to-jsdoc-comments': [
|
|
39
39
|
'error',
|
|
40
40
|
{
|
|
@@ -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,GAAoC;IAC7D,OAAO;QACL;YACE,OAAO,EAAE;gBACP,KAAK;aACN;YAED,QAAQ,EAAE;gBACR,KAAK,EAAE;oBACL,QAAQ,EAAE;wBACR,6EAA6E;wBAC7E,qDAAqD;wBACrD;4BACE,OAAO,EAAE,4DAA4D;4BACrE,OAAO,EAAE,qBAAqB;yBAC/B;wBACD;4BACE,OAAO,EAAE,4DAA4D;4BACrE,OAAO,EAAE,oBAAoB;yBAC9B;wBACD,yBAAyB;wBACzB,mBAAmB;qBACpB;oBACD,iCAAiC,EAAE,IAAI;iBACxC;aACF;SACF;QACD,mBAAmB;QACnB;YACE,KAAK,EAAE,CAAC,eAAe,CAAC;YACxB,KAAK,EAAE;gBACL,GAAG,KAAK,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC,KAAK;gBAC3D,4BAA4B,EAAE,OAAO;gBACrC,uBAAuB,EAAE,OAAO;
|
|
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,GAAoC;IAC7D,OAAO;QACL;YACE,OAAO,EAAE;gBACP,KAAK;aACN;YAED,QAAQ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KAAK;gBAC5B,iCAAiC,EAAE,KAAK;gBACxC,uBAAuB,EAAE,KAAK;gBAC9B,iBAAiB,EAAE,KAAK;aACzB;SACF;KACF,CAAC;AAAA,CACH","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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prairielearn/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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.1",
|
|
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.20260302.1"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/src/configs/base.ts
CHANGED
|
@@ -47,7 +47,7 @@ export function baseConfig(): TSESLint.FlatConfig.ConfigArray {
|
|
|
47
47
|
'max-depth': 'off',
|
|
48
48
|
'max-lines': 'off',
|
|
49
49
|
'max-lines-per-function': 'off',
|
|
50
|
-
'max-params': '
|
|
50
|
+
'max-params': ['error', { max: 6 }],
|
|
51
51
|
'max-statements': 'off',
|
|
52
52
|
'new-cap': 'off',
|
|
53
53
|
'no-await-in-loop': 'off',
|
|
@@ -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',
|
package/src/configs/jsdoc.ts
CHANGED
|
@@ -37,7 +37,7 @@ export function jsdocConfig(): TSESLint.FlatConfig.ConfigArray {
|
|
|
37
37
|
rules: {
|
|
38
38
|
...jsdoc.configs['flat/recommended-typescript-error'].rules,
|
|
39
39
|
'jsdoc/check-line-alignment': 'error',
|
|
40
|
-
'jsdoc/check-tag-names': 'error',
|
|
40
|
+
'jsdoc/check-tag-names': ['error', { definedTags: ['knipignore'] }],
|
|
41
41
|
'jsdoc/convert-to-jsdoc-comments': [
|
|
42
42
|
'error',
|
|
43
43
|
{
|