Skip to content

Commit

Permalink
Update ESLint plugin metadata and fix scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
saberduck committed Nov 29, 2024
1 parent 4ad3e46 commit df519bf
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This repository now hosts [eslint-plugin-sonarjs](./packages/jsts/src/rules/READ
# Features

- Advanced rules based on pattern matching and control flow analysis
- [406 JS rules](https://rules.sonarsource.com/javascript) and [411 TS rules](https://rules.sonarsource.com/typescript)
- [408 JS rules](https://rules.sonarsource.com/javascript) and [413 TS rules](https://rules.sonarsource.com/typescript)
- [26 CSS rules](https://rules.sonarsource.com/css)
- Compatible with ECMAScript 2015-2020
- React JSX, Flow, Vue, and AWS lambda functions support for JavaScript and TypeScript
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:fast": "npm run bridge:build:fast && npm run _:plugin:pre-build && npm run plugin:build:fast",
"bf": "npm run build:fast",
"new-rule": "tsx tools/newRule.ts",
"generate-meta": "tsx tools/generate-meta.ts && cd packages/jsts/src/rules && npm run eslint-docs",
"generate-meta": "tsx tools/generate-meta.ts && npm run format && cd packages/jsts/src/rules && npm run eslint-docs",
"generate-rules-list": "node tools/generate-rules-list.js",
"ruling": "node tools/prepare-ruling.js && tsx --tsconfig packages/tsconfig.test.json --test packages/ruling/tests/projects/*.ruling.test.ts",
"ruling-parametrized": "node tools/prepare-ruling.js && SONAR_RULING_SETTINGS=../settings.js tsx --tsconfig packages/tsconfig.test.json --test packages/ruling/tests/projects/*.ruling.test.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/jsts/src/rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ If you are a [SonarQube](https://www.sonarqube.org) or [SonarCloud](https://sona
| [no-useless-react-setstate](https://sonarsource.github.io/rspec/#/rspec/S6443/javascript) | React state setter function should not be called with its matching state variable || | | | |
| [no-var](https://sonarsource.github.io/rspec/#/rspec/S3504/javascript) | Variables should be declared with "let" or "const" || 🔧 | | | |
| [no-variable-usage-before-declaration](https://sonarsource.github.io/rspec/#/rspec/S1526/javascript) | Variables declared with "var" should be declared before they are used | | | | | |
| [no-vue-bypass-sanitization](https://sonarsource.github.io/rspec/#/rspec/S6299/javascript) | Disabling Vue.js built-in escaping is security-sensitive | | | | | |
| [no-vue-bypass-sanitization](https://sonarsource.github.io/rspec/#/rspec/S6299/javascript) | Disabling Vue.js built-in escaping is security-sensitive | | | | | |
| [no-weak-cipher](https://sonarsource.github.io/rspec/#/rspec/S5547/javascript) | Cipher algorithms should be robust || | | | |
| [no-weak-keys](https://sonarsource.github.io/rspec/#/rspec/S4426/javascript) | Cryptographic keys should be robust || | | | |
| [no-wildcard-import](https://sonarsource.github.io/rspec/#/rspec/S2208/javascript) | Wildcard imports should not be used | | | | | |
Expand Down
1 change: 0 additions & 1 deletion packages/jsts/src/rules/S1291/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/

// DO NOT EDIT! This file is autogenerated by "npm run generate-meta"

export const meta = {
Expand Down
3 changes: 2 additions & 1 deletion packages/jsts/src/rules/S6299/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ export const meta = {
type: 'problem',
docs: {
description: 'Disabling Vue.js built-in escaping is security-sensitive',
recommended: true,
recommended: false,
url: 'https://sonarsource.github.io/rspec/#/rspec/S6299/javascript',
requiresTypeChecking: false,
},
deprecated: true,
};

export const sonarKey = 'S6299';
2 changes: 1 addition & 1 deletion tools/count-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ async function getJsonFiles(pathToRules) {
return Promise.all(
filenames
.filter(filename => filename.endsWith('.json') && filename.length <= 'S1234.json'.length)
.map(async file => await import(path.join(pathToRules, file), { assert: { type: 'json' } })),
.map(async file => await import(path.join(pathToRules, file), { with: { type: 'json' } })),
);
}
15 changes: 5 additions & 10 deletions tools/generate-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,16 @@ function generateMetaForRule(ruleDir: string, ruleId: string) {
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Sonar Source-Available License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
// DO NOT EDIT! This file is autogenerated by "npm run generate-meta"
export const meta = ${JSON.stringify(metadata, null, 2)};
Expand Down

0 comments on commit df519bf

Please sign in to comment.