-
Notifications
You must be signed in to change notification settings - Fork 176
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
JS-192 Build working esling-plugin-sonarjs package #4750
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't manage to run it programmatically without using the linter API, but I believe that what we want to test is CLI usage.
package.json
Outdated
@@ -29,7 +32,8 @@ | |||
"_:plugin:prepare-bridge": "npm pack && node tools/check-distribution-filepath-length.js && npm run _:plugin:copy-bridge", | |||
"_:plugin-fetch-node": "node tools/fetch-node/scripts/wrapper.mjs", | |||
"_:plugin:pre-build": "npm run bridge:build && npm run _:plugin:prepare-bridge && npm run _:plugin-fetch-node", | |||
"_:plugin:copy-bridge": "cpy sonarjs-1.0.0.tgz sonar-plugin/sonar-javascript-plugin/target/classes && cpy sonarjs-1.0.0.tgz sonar-plugin/standalone/target/classes" | |||
"_:plugin:copy-bridge": "cpy sonarjs-1.0.0.tgz sonar-plugin/sonar-javascript-plugin/target/classes && cpy sonarjs-1.0.0.tgz sonar-plugin/standalone/target/classes", | |||
"eslint-plugin:pack": "cpy lib packages/eslint-plugin-sonarjs && npm pack --workspaces && rm -rf packages/eslint-plugin-sonarjs/lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe I could move this to packages/eslint-plugin-sonarjs/package.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these changes is because I removed the debug log containing ruleId
in https://github.com/SonarSource/SonarJS/pull/4750/files#diff-0bab53c07af551fd3f82e7fc7a78b69e6a3aa892e5a27c4de9617025d27ef4ac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot load all of linter because of:
Cannot find module '@sonar/shared' from 'node_modules/eslint-plugin-sonarjs/lib/jsts/src/linter/config/linter-config.js'
Require stack:
node_modules/eslint-plugin-sonarjs/lib/jsts/src/linter/config/linter-config.js
node_modules/eslint-plugin-sonarjs/lib/jsts/src/linter/config/index.js
node_modules/eslint-plugin-sonarjs/lib/jsts/src/linter/index.js
node_modules/eslint-plugin-sonarjs/lib/jsts/src/rules/S2699/rule.js
node_modules/eslint-plugin-sonarjs/lib/jsts/src/rules/S2699/index.js
node_modules/eslint-plugin-sonarjs/lib/eslint-plugin-sonarjs/src/index.js
test/unit/index.test.ts
rules['xml-parser-xxe'] = S2755; | ||
rules['xpath'] = S4817; | ||
|
||
//import { name, version } from '../package.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find some solution for this: the path is different in the transpiled code, so it fails when running the generated package.
|
||
cd its/eslint-plugin-sonarjs | ||
|
||
rm -rf node_modules/eslint-plugin-sonarjs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this is not necessary anymore
|
here were the issues I ran into for a few rules that I had decided to omit from the package:
|
Fixes #