mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
chore(jsdoc-eslint-config): migrate to ESLint flat config
This commit is contained in:
parent
ae2c9da9ba
commit
55b0489662
@ -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/**
|
||||
@ -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
54
package-lock.json
generated
@ -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",
|
||||
|
||||
@ -14,8 +14,6 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/* global jsdoc */
|
||||
|
||||
import * as astBuilder from '../../../lib/ast-builder.js';
|
||||
|
||||
const { AstBuilder } = astBuilder;
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -14,8 +14,6 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/* global jsdoc */
|
||||
|
||||
import EventEmitter from 'node:events';
|
||||
import path from 'node:path';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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`.
|
||||
|
||||
@ -14,8 +14,6 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/* global jsdoc */
|
||||
|
||||
import EventEmitter from 'node:events';
|
||||
import path from 'node:path';
|
||||
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -13,4 +13,5 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// TODO: Write tests
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -14,8 +14,6 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/* global jsdoc */
|
||||
|
||||
import * as jsdocPackage from '../../../lib/package.js';
|
||||
|
||||
const { Package } = jsdocPackage;
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -13,23 +13,41 @@
|
||||
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';
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: [
|
||||
'**/out/',
|
||||
'**/tmp/',
|
||||
'coverage/',
|
||||
'packages/**/static/**',
|
||||
'packages/**/test/fixtures/**',
|
||||
],
|
||||
},
|
||||
|
||||
parser: '@babel/eslint-parser',
|
||||
parserOptions: {
|
||||
{
|
||||
files: ['**/*.cjs', '**/*.js', '**/*.mjs'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
globals: {
|
||||
...globals.jasmine,
|
||||
...globals.node,
|
||||
},
|
||||
parser: babelParser,
|
||||
parserOptions: {
|
||||
requireConfigFile: false,
|
||||
},
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['prettier', 'simple-import-sort'],
|
||||
|
||||
plugins: {
|
||||
prettier,
|
||||
'simple-import-sort': simpleImportSort,
|
||||
},
|
||||
rules: {
|
||||
// Possible errors
|
||||
'array-callback-return': 'error',
|
||||
@ -237,11 +255,13 @@ module.exports = {
|
||||
'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',
|
||||
|
||||
// https://github.com/lydell/eslint-plugin-simple-import-sort
|
||||
'simple-import-sort/exports': 'error',
|
||||
'simple-import-sort/imports': 'error',
|
||||
},
|
||||
};
|
||||
},
|
||||
prettierConfig,
|
||||
];
|
||||
|
||||
@ -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"
|
||||
},
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -14,8 +14,6 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/* global jsdoc */
|
||||
|
||||
import { Tag } from '../../../lib/tag.js';
|
||||
import * as validator from '../../../lib/validator.js';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -14,8 +14,6 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/* global jsdoc */
|
||||
|
||||
import getLogFunctions from '../../../lib/log.js';
|
||||
|
||||
describe('@jsdoc/util/lib/log', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user