Skip to content

Commit

Permalink
Fix eslint-plugin with SonarQube 25
Browse files Browse the repository at this point in the history
  • Loading branch information
utarwyn committed Jan 20, 2025
1 parent 02261de commit 71ffac3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ dependency-reduced-pom.xml

# Auto-generated files
coverage
dist
1 change: 1 addition & 0 deletions eslint-plugin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ node_modules
# Auto-generated files
*-report.json
.nyc_output
dist/pack
2 changes: 1 addition & 1 deletion eslint-plugin/lib/sonar.js → eslint-plugin/dist/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
"use strict";

const rules = require("./rule-list");
const rules = require("../lib/rule-list");

module.exports = {
rules: rules.map((rule) => ({
Expand Down
7 changes: 4 additions & 3 deletions eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@
"author": "Green Code Initiative",
"main": "./lib/standalone.js",
"files": [
"lib"
"lib",
"./dist/rules.js"
],
"scripts": {
"clean": "rimraf dist",
"clean": "rimraf dist/pack",
"lint": "yarn lint:eslint-docs && yarn lint:js",
"lint:eslint-docs": "eslint-doc-generator --check",
"lint:js": "eslint .",
"lint:fix": "eslint . --fix",
"pack:sonar": "npm pkg set main=\"./lib/sonar.js\" && mkdirp dist/pack && yarn pack -o dist/pack/creedengo-eslint-plugin.tgz && npm pkg set main=\"./lib/standalone.js\"",
"pack:sonar": "npm pkg set main=\"./dist/rules.js\" && mkdirp dist/pack && yarn pack -o dist/pack/creedengo-eslint-plugin.tgz && npm pkg set main=\"./lib/standalone.js\"",
"test": "mocha tests --recursive",
"test:cov": "nyc --reporter=lcov --reporter=text mocha tests --recursive",
"update:eslint-docs": "eslint-doc-generator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

const assert = require("assert");

describe("sonar.js", () => {
describe("rules.js", () => {
it("should export all rules with a specific rule id pattern", () => {
const { rules } = require("../../lib/sonar");
const { rules } = require("../../dist/rules");
assert.notEqual(rules.length, 0);
assert.match(rules[0].ruleId, /@creedengo\/.*/);
assert.equal(rules[0].ruleConfig.length, 0);
Expand Down

0 comments on commit 71ffac3

Please sign in to comment.