-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
Description
Hi,
I get a weird bug when trying to run with your plugin and I am not sure what it is.
Expected behavior
Should execute and report based on rules.
Actual behavior
Can't run lint.
This error appears
> npx eslint $(git diff --name-only HEAD | grep -E '\.(js|jsx)$' | xargs) --fix
Oops! Something went wrong! :(
ESLint: 8.13.0
/root/v3/SC-V3-T4/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:259
})() ?? jsdoc.source.findIndex(({
^
SyntaxError: Unexpected token '?'
at new Script (vm.js:84:7)
at NativeCompileCache._moduleCompile (/root/v3/SC-V3-T4/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
at Module._compile (/root/v3/SC-V3-T4/node_modules/v8-compile-cache/v8-compile-cache.js:184:36)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Module.require (internal/modules/cjs/loader.js:848:19)
at require (/root/v3/SC-V3-T4/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/root/v3/SC-V3-T4/node_modules/eslint-plugin-jsdoc/dist/rules/checkAccess.js:8:44)
at Module._compile (/root/v3/SC-V3-T4/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
(node:2617) Warning: require() of ES modules is not supported.
require() of /root/v3/SC-V3-T4/node_modules/@eslint/eslintrc/universal.js from /root/v3/SC-V3-T4/node_modules/eslint/lib/linter/linter.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename universal.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /root/v3/SC-V3-T4/node_modules/@eslint/eslintrc/package.json.
ESLint Config
// Format JS (or JSON) code here
{
"env": {
"es2021": true,
"node": true
},
"extends": ["eslint:recommended","plugin:jest/recommended"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"ecmaVersion": "latest",
"globalReturn": false
},
"sourceType": "module"
},
"plugins": ["jsdoc","jest"],
"rules": {
"indent": ["warn", "tab", {
"SwitchCase": 1
}],
"linebreak-style": ["warn", "unix"],
"no-dupe-keys":"warn",
"no-inner-declarations":"off",
"no-empty":"warn",
"no-mixed-spaces-and-tabs":"warn",
"no-unused-vars": "warn",
"quotes": ["warn", "double"],
"semi": ["warn", "always"],
//"no-undef": "off", // sa fessait des erreur sur toute nos console
"no-tabs": "off", // disallow all tabs - https://eslint.org/docs/rules/no-tabs
"no-template-curly-in-string": "warn", //utile quand on utilise `` pour mettre du code avec un string sa force lutilisation de 11 au lieux de guillemet - https://eslint.org/docs/rules/no-template-curly-in-string
"block-scoped-var": "warn", //enforce the use of variables within the scope they are defined - https://eslint.org/docs/rules/block-scoped-var
"default-case": "warn", //require `default` cases in `switch` statements - https://eslint.org/docs/rules/default-case
"no-alert": "warn", //disallow the use of `alert`, `confirm`, and `prompt` - https://eslint.org/docs/rules/no-alert
"no-multi-spaces": "warn", //disallow multiple spaces https://eslint.org/docs/rules/no-multi-spaces
"vars-on-top": "warn", //require `var` declarations be placed at the top of their containing scope - https://eslint.org/docs/rules/vars-on-top
"no-label-var": "warn", // disallow labels that share a name with a variable - https://eslint.org/docs/rules/no-label-var
"no-use-before-define": "warn", //disallow the use of variables before they are defined - https://eslint.org/docs/rules/no-use-before-define
"comma-dangle": ["warn", "always-multiline"], // require or disallow trailing commas - https://eslint.org/docs/rules/comma-dangle
"comma-spacing": ["warn", { "after": true }], //enforce consistent spacing before and after commas - https://eslint.org/docs/rules/comma-spacing
"comma-style": ["warn", "last"], //enforce consistent comma style - https://eslint.org/docs/rules/comma-style
"func-call-spacing": ["warn", "never"], //require or disallow spacing between function identifiers and their invocations - https://eslint.org/docs/rules/func-call-spacing
"no-trailing-spaces": [
"warn",
{
//disallow trailing whitespace at the end of lines - https://eslint.org/docs/rules/no-trailing-spaces
"skipBlankLines": false,
"ignoreComments": true
}
],
"semi-style": ["warn", "last"], //enforce location of semicolons - https://eslint.org/docs/rules/semi-style
"space-before-blocks": ["warn", "never"], //enforce consistent spacing before blocks - https://eslint.org/docs/rules/space-before-blocks
"space-before-function-paren": ["warn", "never"], //enforce consistent spacing before `function` definition opening parenthesis - https://eslint.org/docs/rules/space-before-function-paren
"arrow-body-style": ["warn", "as-needed"], //require braces around arrow function bodies - https://eslint.org/docs/rules/arrow-body-style
"arrow-parens": ["warn", "as-needed"], //require parentheses around arrow function arguments - https://eslint.org/docs/rules/arrow-parens
"no-var": "warn", //require `let` or `const` instead of `var` - https://eslint.org/docs/rules/no-var
"no-case-declarations":"warn",
"no-async-promise-executor":"warn",
"jsdoc/require-jsdoc": ["warn", {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": false,
"ArrowFunctionExpression": true,
"FunctionExpression": true,
"ClassExpression": true
}],
"no-useless-concat": ["warn"],
"prefer-template": ["warn"],
"keyword-spacing": ["warn"]
}
}
Environment
- Node version: v12.15.0
- ESLint version: eslint@8.13.0
eslint-plugin-jsdocversion: eslint-plugin-jsdoc@39.2.3
Hope you can help.