Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint 9 alpha #1177

Merged
merged 2 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
node-version: '20'
- run: pnpm install
- run: pnpm build
- run: pnpm lint
timeout-minutes: 10
test:
Expand All @@ -39,7 +40,6 @@ jobs:
fail-fast: false
matrix:
node_js_version:
- '16'
- '18'
- '20'
build:
Expand Down
1 change: 1 addition & 0 deletions .ncurc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
reject: [
// Todo: When package converted to ESM
'camelcase',
'chai',
'decamelize',
'escape-string-regexp',
'open-editor',
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Tests are expected. Each rule file should be in CamelCase (despite the rule name

Each rule file should be an ESM default export of an object that has `valid` and `invalid` array properties containing the tests. Tests of each type should be provided.

`parserOptions` will be `ecmaVersion: 6` by default, but tests can override `parserOptions`
`languageOptions` will be `ecmaVersion: 6` by default, but tests can override `languageOptions`
with their own.

See ESLint's [RuleTester](https://eslint.org/docs/developer-guide/nodejs-api#ruletester)
Expand Down
72 changes: 72 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import globals from 'globals';
import jsdoc from './dist/index.js';
// import canonical from 'eslint-config-canonical';
// import canonicalJsdoc from 'eslint-config-canonical/jsdoc.js';

const common = {
linterOptions: {
reportUnusedDisableDirectives: 0
},
plugins: {
jsdoc
}
};

export default [
// canonical,
// canonicalJsdoc,
{
...common,
files: ['.ncurc.js'],
languageOptions: {
parserOptions: {
ecmaFeatures: {
impliedStrict: false
},
},
sourceType: 'script'
},
rules: {
'import/no-commonjs': 0,
strict: [
'error',
'global'
]
}
},
{
...common,
files: ['test/**/*.js'],
rules: {
'no-restricted-syntax': 0,
'unicorn/prevent-abbreviations': 0
}
},
{
...common,
ignores: ['dist/**/*.js', '.ignore/**/*.js'],
languageOptions: {
globals: globals.node
},
settings: {
jsdoc: {
mode: 'typescript'
}
},
rules: {
'array-element-newline': 0,
'filenames/match-regex': 0,
'import/extensions': 0,
'import/no-useless-path-segments': 0,
'prefer-named-capture-group': 0,
'unicorn/no-array-reduce': 0,
'unicorn/no-unsafe-regex': 0,
'unicorn/prefer-array-some': 0,
'unicorn/prevent-abbreviations': 0,
'unicorn/import-index': 0,
'linebreak-style': 0,
'no-inline-comments': 0,
'no-extra-parens': 0
}
}
];
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,43 @@
"description": "JSDoc linting rules for ESLint.",
"devDependencies": {
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.5",
"@babel/core": "^7.23.7",
"@babel/eslint-parser": "^7.23.3",
"@babel/node": "^7.22.19",
"@babel/plugin-syntax-class-properties": "^7.12.13",
"@babel/plugin-transform-flow-strip-types": "^7.23.3",
"@babel/preset-env": "^7.23.5",
"@babel/register": "^7.22.15",
"@babel/preset-env": "^7.23.7",
"@babel/register": "^7.23.7",
"@es-joy/escodegen": "^3.5.1",
"@es-joy/jsdoc-eslint-parser": "^0.20.0",
"@es-joy/jsdoc-eslint-parser": "^0.21.1",
"@hkdobrev/run-if-changed": "^0.3.1",
"@semantic-release/commit-analyzer": "^11.1.0",
"@semantic-release/github": "^9.2.5",
"@semantic-release/github": "^9.2.6",
"@semantic-release/npm": "^11.0.2",
"@types/chai": "^4.3.11",
"@types/debug": "^4.1.12",
"@types/eslint": "^8.44.8",
"@types/eslint": "^8.56.0",
"@types/esquery": "^1.5.3",
"@types/estree": "^1.0.5",
"@types/json-schema": "^7.0.15",
"@types/lodash.defaultsdeep": "^4.6.9",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.4",
"@types/node": "^20.10.6",
"@types/semver": "^7.5.6",
"@types/spdx-expression-parse": "^3.0.5",
"@typescript-eslint/parser": "^6.13.2",
"@typescript-eslint/parser": "^6.16.0",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-istanbul": "^6.1.1",
"camelcase": "^6.3.0",
"chai": "^4.3.10",
"cross-env": "^7.0.3",
"decamelize": "^5.0.1",
"eslint": "8.55.0",
"eslint": "9.0.0-alpha.0",
"eslint-config-canonical": "~42.8.0",
"espree": "^9.6.1",
"gitdown": "^3.1.5",
"glob": "^10.3.10",
"globals": "^13.24.0",
"husky": "^8.0.3",
"jsdoc-type-pratt-parser": "^4.0.0",
"json-schema": "^0.4.0",
Expand All @@ -63,11 +64,11 @@
"nyc": "^15.1.0",
"open-editor": "^3.0.0",
"rimraf": "^5.0.5",
"semantic-release": "^22.0.10",
"semantic-release": "^22.0.12",
"typescript": "5.3.3"
},
"engines": {
"node": ">=16"
"node": ">=18"
},
"keywords": [
"eslint",
Expand Down Expand Up @@ -113,7 +114,7 @@
"statements": 100
},
"peerDependencies": {
"eslint": "^7.0.0 || ^8.0.0"
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
},
"repository": {
"type": "git",
Expand All @@ -132,7 +133,7 @@
"create-options": "node ./src/bin/generateOptions.mjs",
"install-offline": "pnpm install --prefer-offline --no-audit",
"lint": "npm run lint-arg -- .",
"lint-arg": "eslint --report-unused-disable-directives",
"lint-arg": "eslint --report-unused-disable-directives=false",
"lint-fix": "npm run lint-arg -- --fix .",
"prepare": "husky install",
"test-no-cov": "cross-env BABEL_ENV=test mocha",
Expand Down
Loading