chore(jsdoc-eslint-config): migrate to ESLint flat config

This commit is contained in:
Jeff Williams 2024-04-14 11:39:46 -07:00
parent ae2c9da9ba
commit 55b0489662
No known key found for this signature in database
42 changed files with 334 additions and 298 deletions

View File

@ -1,14 +0,0 @@
# Ignore output files.
**/out/
# Ignore temp directories.
**/tmp/
# Ignore code coverage reports.
coverage/
# Ignore static files that are part of JSDoc's output.
packages/**/static/**
# Ignore test fixtures.
packages/**/test/fixtures/**

View File

@ -13,7 +13,17 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
module.exports = {
extends: ['@jsdoc'],
root: true,
};
import jsdoc from '@jsdoc/eslint-config';
export default [
{
files: ['packages/**/test/**'],
languageOptions: {
globals: {
jsdoc: 'readonly',
},
},
},
...jsdoc,
];

54
package-lock.json generated
View File

@ -455,9 +455,9 @@
}
},
"node_modules/@eslint/eslintrc/node_modules/globals": {
"version": "13.21.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz",
"integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==",
"version": "13.24.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dependencies": {
"type-fest": "^0.20.2"
},
@ -545,9 +545,9 @@
}
},
"node_modules/@humanwhocodes/object-schema": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz",
"integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw=="
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA=="
},
"node_modules/@hutson/parse-repository-url": {
"version": "3.0.2",
@ -2138,9 +2138,9 @@
}
},
"node_modules/acorn": {
"version": "8.10.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
"integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==",
"version": "8.11.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
"bin": {
"acorn": "bin/acorn"
},
@ -4470,16 +4470,16 @@
}
},
"node_modules/flat-cache": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz",
"integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
"integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
"dependencies": {
"flatted": "^3.2.7",
"flatted": "^3.2.9",
"keyv": "^4.5.3",
"rimraf": "^3.0.2"
},
"engines": {
"node": ">=12.0.0"
"node": "^10.12.0 || >=12.0.0"
}
},
"node_modules/flat-cache/node_modules/glob": {
@ -4527,9 +4527,9 @@
}
},
"node_modules/flatted": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw=="
},
"node_modules/follow-redirects": {
"version": "1.15.6",
@ -6608,9 +6608,9 @@
}
},
"node_modules/keyv": {
"version": "4.5.3",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz",
"integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==",
"version": "4.5.4",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
"integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
"dependencies": {
"json-buffer": "3.0.1"
}
@ -12586,7 +12586,8 @@
"@babel/eslint-parser": "^7.24.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.1.0"
"eslint-plugin-simple-import-sort": "^12.1.0",
"globals": "^15.0.0"
},
"engines": {
"node": ">=v18.12.0"
@ -12596,6 +12597,17 @@
"prettier": ">= 3.2.5"
}
},
"packages/jsdoc-eslint-config/node_modules/globals": {
"version": "15.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-15.0.0.tgz",
"integrity": "sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"packages/jsdoc-parse": {
"name": "@jsdoc/parse",
"version": "0.3.10",

View File

@ -14,8 +14,6 @@
limitations under the License.
*/
/* global jsdoc */
import * as astBuilder from '../../../lib/ast-builder.js';
const { AstBuilder } = astBuilder;

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import Engine from '../../index.js';
import engine from '../../lib/engine.js';

View File

@ -14,8 +14,6 @@
limitations under the License.
*/
/* global jsdoc */
import EventEmitter from 'node:events';
import path from 'node:path';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import ow from 'ow';
import { flags, parseFlags } from '../../../lib/flags.js';

View File

@ -13,4 +13,5 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
// `@jsdoc/cli/lib/help` is tested indirectly by the tests for `@jsdoc/cli/lib/engine`.

View File

@ -14,8 +14,6 @@
limitations under the License.
*/
/* global jsdoc */
import EventEmitter from 'node:events';
import path from 'node:path';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as name from '../../../lib/name.js';
describe('@jsdoc/core.name', () => {

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import path from 'node:path';
import * as plugins from '../../../lib/plugins.js';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import doclet from '../../index.js';
import * as augment from '../../lib/augment.js';
import { resolveBorrows } from '../../lib/borrow.js';

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import * as augment from '../../../lib/augment.js';
describe('@jsdoc/doclet/lib/augment', () => {

View File

@ -13,4 +13,5 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
// TODO: Write tests

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import { name } from '@jsdoc/core';
import { Doclet } from '../../../lib/doclet.js';

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import { name } from '@jsdoc/core';
import _ from 'lodash';

View File

@ -14,8 +14,6 @@
limitations under the License.
*/
/* global jsdoc */
import * as jsdocPackage from '../../../lib/package.js';
const { Package } = jsdocPackage;

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as schema from '../../../lib/schema.js';
describe('@jsdoc/doclet/lib/schema', () => {

View File

@ -13,235 +13,255 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
module.exports = {
extends: ['plugin:prettier/recommended'],
env: {
es6: true,
jasmine: true,
node: true,
},
import babelParser from '@babel/eslint-parser';
import prettier from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-plugin-prettier/recommended';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
requireConfigFile: false,
sourceType: 'module',
},
plugins: ['prettier', 'simple-import-sort'],
rules: {
// Possible errors
'array-callback-return': 'error',
'constructor-super': 'error',
'for-direction': 'error',
'getter-return': 'error',
'no-async-promise-executor': 'error',
'no-await-in-loop': 'error',
'no-class-assign': 'error',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-constant-binary-expression': 'error',
'no-constant-condition': 'off',
'no-constructor-return': 'off',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': [
'error',
{
includeExports: true,
},
export default [
{
ignores: [
'**/out/',
'**/tmp/',
'coverage/',
'packages/**/static/**',
'packages/**/test/fixtures/**',
],
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-fallthrough': 'off', // disabled due to bug in ESLint
'no-func-assign': 'error',
'no-import-assign': 'error',
'no-inner-declarations': ['error', 'functions'],
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-loss-of-precision': 'error',
'no-misleading-character-class': 'error',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
'no-promise-executor-return': 'error',
'no-prototype-builtins': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-setter-return': 'error',
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-this-before-super': 'error',
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable': 'error',
'no-unreachable-loop': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unsafe-optional-chaining': 'error',
'no-unused-private-class-members': 'error',
'no-unused-vars': 'error',
'no-use-before-define': 'error',
'no-useless-backreference': 'error',
'require-atomic-updates': 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
// Suggestions
'accessor-pairs': 'error',
'arrow-body-style': ['error', 'as-needed'],
'block-scoped-var': 'off',
camelcase: 'error',
'capitalized-comments': 'off',
'class-methods-use-this': 'off',
complexity: 'off', // TODO: enable
'consistent-return': 'error',
'consistent-this': ['error', 'self'],
curly: ['error', 'all'],
'default-case': 'error',
'default-case-last': 'error',
'default-param-last': 'error',
'dot-notation': 'error',
eqeqeq: ['error', 'smart'],
'func-name-matching': ['error', 'always'],
'func-names': 'off',
'func-style': 'off',
'grouped-accessor-pairs': 'error',
'guard-for-in': 'error',
'id-denylist': 'off',
'id-length': 'off',
'id-match': 'off',
'init-declarations': 'off',
'max-classes-per-file': 'off',
'max-depth': 'off', // TODO: enable
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-nested-callbacks': 'off',
'max-params': 'off', // TODO: enable
'max-statements': 'off',
'multiline-comment-style': 'off',
'new-cap': 'error',
'no-alert': 'error',
'no-array-constructor': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-case-declarations': 'error',
'no-console': 'off',
'no-continue': 'off',
'no-delete-var': 'error',
'no-div-regex': 'error',
'no-else-return': 'off',
'no-empty': 'error',
'no-empty-function': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-global-assign': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-inline-comments': 'off',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loop-func': 'error',
'no-magic-numbers': 'off', // TODO: enable?
'no-multi-assign': 'off',
'no-multi-str': 'error',
'no-negated-condition': 'off',
'no-nested-ternary': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-nonoctal-decimal-escape': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-proto': 'error',
'no-redeclare': 'error',
'no-regex-spaces': 'error',
'no-restricted-exports': 'off',
'no-restricted-globals': ['error', 'app', 'env'],
'no-restricted-imports': 'off',
'no-restricted-properties': 'off',
'no-restricted-syntax': 'off',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-sequences': 'error',
'no-shadow': 'error',
'no-shadow-restricted-names': 'error',
'no-ternary': 'off',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-undefined': 'off',
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'off',
'no-useless-escape': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'off', // TODO: enable
'no-void': 'error',
'no-warning-comments': 'off',
'no-with': 'error',
'object-shorthand': 'off',
'one-var': 'off',
'operator-assignment': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'prefer-exponentiation-operator': 'error',
'prefer-named-capture-group': 'off', // TODO: enable
'prefer-numeric-literals': 'off',
'prefer-object-has-own': 'off', // TODO: enable
'prefer-object-spread': 'off',
'prefer-promise-reject-errors': 'error',
'prefer-regex-literals': 'error',
'prefer-rest-params': 'off',
'prefer-spread': 'off',
'prefer-template': 'off',
radix: 'error',
'require-await': 'error',
'require-unicode-regexp': 'off',
'require-yield': 'error',
'sort-imports': 'off', // We use https://github.com/lydell/eslint-plugin-simple-import-sort instead
'sort-keys': 'off',
'sort-vars': 'off', // TODO: enable?
strict: ['error', 'global'],
'symbol-description': 'error',
'vars-on-top': 'off', // TODO: enable
yoda: 'error',
// Layout and formatting
'line-comment-position': 'off',
'unicode-bom': ['error', 'never'],
// https://github.com/lydell/eslint-plugin-simple-import-sort
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
// https://github.com/prettier/eslint-plugin-prettier
'prettier/prettier': 'error',
},
};
{
files: ['**/*.cjs', '**/*.js', '**/*.mjs'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.jasmine,
...globals.node,
},
parser: babelParser,
parserOptions: {
requireConfigFile: false,
},
sourceType: 'module',
},
plugins: {
prettier,
'simple-import-sort': simpleImportSort,
},
rules: {
// Possible errors
'array-callback-return': 'error',
'constructor-super': 'error',
'for-direction': 'error',
'getter-return': 'error',
'no-async-promise-executor': 'error',
'no-await-in-loop': 'error',
'no-class-assign': 'error',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-constant-binary-expression': 'error',
'no-constant-condition': 'off',
'no-constructor-return': 'off',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': [
'error',
{
includeExports: true,
},
],
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-fallthrough': 'off', // disabled due to bug in ESLint
'no-func-assign': 'error',
'no-import-assign': 'error',
'no-inner-declarations': ['error', 'functions'],
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-loss-of-precision': 'error',
'no-misleading-character-class': 'error',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
'no-promise-executor-return': 'error',
'no-prototype-builtins': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-setter-return': 'error',
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-this-before-super': 'error',
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable': 'error',
'no-unreachable-loop': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unsafe-optional-chaining': 'error',
'no-unused-private-class-members': 'error',
'no-unused-vars': 'error',
'no-use-before-define': 'error',
'no-useless-backreference': 'error',
'require-atomic-updates': 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
// Suggestions
'accessor-pairs': 'error',
'arrow-body-style': ['error', 'as-needed'],
'block-scoped-var': 'off',
camelcase: 'error',
'capitalized-comments': 'off',
'class-methods-use-this': 'off',
complexity: 'off', // TODO: enable
'consistent-return': 'error',
'consistent-this': ['error', 'self'],
curly: ['error', 'all'],
'default-case': 'error',
'default-case-last': 'error',
'default-param-last': 'error',
'dot-notation': 'error',
eqeqeq: ['error', 'smart'],
'func-name-matching': ['error', 'always'],
'func-names': 'off',
'func-style': 'off',
'grouped-accessor-pairs': 'error',
'guard-for-in': 'error',
'id-denylist': 'off',
'id-length': 'off',
'id-match': 'off',
'init-declarations': 'off',
'max-classes-per-file': 'off',
'max-depth': 'off', // TODO: enable
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-nested-callbacks': 'off',
'max-params': 'off', // TODO: enable
'max-statements': 'off',
'multiline-comment-style': 'off',
'new-cap': 'error',
'no-alert': 'error',
'no-array-constructor': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-case-declarations': 'error',
'no-console': 'off',
'no-continue': 'off',
'no-delete-var': 'error',
'no-div-regex': 'error',
'no-else-return': 'off',
'no-empty': 'error',
'no-empty-function': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-global-assign': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-inline-comments': 'off',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loop-func': 'error',
'no-magic-numbers': 'off', // TODO: enable?
'no-multi-assign': 'off',
'no-multi-str': 'error',
'no-negated-condition': 'off',
'no-nested-ternary': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-nonoctal-decimal-escape': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-proto': 'error',
'no-redeclare': 'error',
'no-regex-spaces': 'error',
'no-restricted-exports': 'off',
'no-restricted-globals': ['error', 'app', 'env'],
'no-restricted-imports': 'off',
'no-restricted-properties': 'off',
'no-restricted-syntax': 'off',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-sequences': 'error',
'no-shadow': 'error',
'no-shadow-restricted-names': 'error',
'no-ternary': 'off',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-undefined': 'off',
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'off',
'no-useless-escape': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'off', // TODO: enable
'no-void': 'error',
'no-warning-comments': 'off',
'no-with': 'error',
'object-shorthand': 'off',
'one-var': 'off',
'operator-assignment': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'prefer-exponentiation-operator': 'error',
'prefer-named-capture-group': 'off', // TODO: enable
'prefer-numeric-literals': 'off',
'prefer-object-has-own': 'off', // TODO: enable
'prefer-object-spread': 'off',
'prefer-promise-reject-errors': 'error',
'prefer-regex-literals': 'error',
'prefer-rest-params': 'off',
'prefer-spread': 'off',
'prefer-template': 'off',
radix: 'error',
'require-await': 'error',
'require-unicode-regexp': 'off',
'require-yield': 'error',
'sort-imports': 'off', // We use https://github.com/lydell/eslint-plugin-simple-import-sort instead
'sort-keys': 'off',
'sort-vars': 'off', // TODO: enable?
strict: ['error', 'global'],
'symbol-description': 'error',
'vars-on-top': 'off', // TODO: enable
yoda: 'error',
// Layout and formatting
'line-comment-position': 'off',
'unicode-bom': ['error', 'never'],
// https://github.com/prettier/eslint-plugin-prettier
'prettier/prettier': 'error',
// https://github.com/lydell/eslint-plugin-simple-import-sort
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
},
},
prettierConfig,
];

View File

@ -14,7 +14,8 @@
"@babel/eslint-parser": "^7.24.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.1.0"
"eslint-plugin-simple-import-sort": "^12.1.0",
"globals": "^15.0.0"
},
"peerDependencies": {
"eslint": ">= 8.57.0",
@ -33,7 +34,12 @@
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "commonjs",
"type": "module",
"exports": {
".": {
"import": "./index.js"
}
},
"engines": {
"node": ">=v18.12.0"
},

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import * as handlers from '../../../lib/handlers.js';
describe('@jsdoc/parse/lib/handlers', () => {

View File

@ -13,8 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* eslint-disable no-script-url */
/* global jsdoc */
import fs from 'node:fs';
import path from 'node:path';

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import { Parser } from '../../../lib/parser.js';
import { Visitor } from '../../../lib/visitor.js';

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import path from 'node:path';
import { plugins } from '@jsdoc/core';

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import path from 'node:path';
import { plugins } from '@jsdoc/core';

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import path from 'node:path';
import { plugins } from '@jsdoc/core';

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import path from 'node:path';
import { plugins } from '@jsdoc/core';

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import path from 'node:path';
import { plugins } from '@jsdoc/core';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as summarize from '../../summarize.js';
describe('summarize', () => {

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import path from 'node:path';
import { plugins } from '@jsdoc/core';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import tag from '../../index.js';
import definitions from '../../lib/definitions/index.js';
import { Dictionary } from '../../lib/dictionary.js';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as definitions from '../../../../lib/definitions/index.js';
describe('@jsdoc/tag/lib/definitions', () => {

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import { Dictionary } from '../../../lib/dictionary.js';
describe('@jsdoc/tag/lib/dictionary', () => {

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as inline from '../../../lib/inline.js';
describe('@jsdoc/tag/lib/inline', () => {

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global jsdoc */
import * as jsdocTag from '../../../lib/tag.js';
import * as type from '../../../lib/type.js';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as type from '../../../lib/type.js';
describe('@jsdoc/tag/lib/type', () => {

View File

@ -14,8 +14,6 @@
limitations under the License.
*/
/* global jsdoc */
import { Tag } from '../../../lib/tag.js';
import * as validator from '../../../lib/validator.js';

View File

@ -14,8 +14,6 @@
limitations under the License.
*/
/* global jsdoc */
import { Env } from '@jsdoc/core';
import { Doclet } from '@jsdoc/doclet';
import salty from '@jsdoc/salty';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import util from '../../index.js';
import bus from '../../lib/bus.js';
import cast from '../../lib/cast.js';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import EventEmitter from 'node:events';
import EventBus from '../../../lib/bus.js';

View File

@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import cast from '../../../lib/cast.js';
describe('@jsdoc/util/lib/cast', () => {

View File

@ -14,8 +14,6 @@
limitations under the License.
*/
/* global jsdoc */
import getLogFunctions from '../../../lib/log.js';
describe('@jsdoc/util/lib/log', () => {