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

JS-421 Fix new-rule script #4917

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f980c2d
ESLINTJS-65 Remove decorated rules from ESLint plugin
vdiez Nov 25, 2024
cf8f4a5
fix tests and eslint plugin
vdiez Nov 25, 2024
42a6e0c
fix tests and eslint plugin
vdiez Nov 25, 2024
f20a77a
fix tests and eslint plugin
vdiez Nov 25, 2024
67092c8
remove decorated rule from its test
vdiez Nov 25, 2024
23c92de
remove unneeded dependencies
vdiez Nov 26, 2024
4484d3d
Use prettier to format markdown on generation
vdiez Nov 26, 2024
aafefae
Update licenses
vdiez Nov 26, 2024
9ab921d
Merge branch 'master' into remove-decorated-eslint
vdiez Nov 26, 2024
7bcfd67
add S1291 to new metadata format
vdiez Nov 26, 2024
26480e6
add source of rule for external rules
vdiez Nov 26, 2024
a050d02
Added metadata for decorated rules
vdiez Nov 26, 2024
26a92c4
Added explanation in README.md about external rules
vdiez Nov 26, 2024
5f8067f
Added explanation in README.md about external rules
vdiez Nov 26, 2024
ddeb3bc
do not limit to eslint 9.14
vdiez Nov 26, 2024
9c55e6e
fix header
vdiez Nov 26, 2024
edb8cb2
Merge branch 'master' into remove-decorated-eslint
vdiez Nov 27, 2024
d167687
Merge branch 'master' into remove-decorated-eslint
vdiez Nov 27, 2024
8403629
Update tools/generate-rule-indexes.ts
vdiez Nov 28, 2024
0dbb35b
Update packages/jsts/src/rules/README.md
vdiez Nov 28, 2024
80ecc27
Update packages/jsts/src/rules/README.md
vdiez Nov 28, 2024
7859912
Update packages/jsts/src/rules/README.md
vdiez Nov 28, 2024
87fa9e6
improve wording on README.md
vdiez Nov 28, 2024
f785d58
changes on index.test.ts after review
vdiez Nov 28, 2024
294dcab
Rename Java checks classes to use Sonar rule ids
vdiez Nov 29, 2024
f9151d0
Do not track generated-meta.ts
vdiez Nov 29, 2024
df8c9fd
Refactor tool scripts
vdiez Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .eslint-doc-generatorrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
const rules = require('./lib').rules;
const prettier = require('prettier');
const { prettier: prettierOpts } = require('./package.json');

/** @type {import('eslint-doc-generator').GenerateOptions} */
const config = {
urlRuleDoc(name) {
return rules[name].meta.docs.url;
},
postprocess: content => content.replace('<table>', '&lt;table&gt;'),
ignoreConfig: ['recommended-legacy'],
pathRuleDoc(name) {
return `docs/${name}.md`;
Expand All @@ -36,6 +37,11 @@ const config = {
'requiresTypeChecking',
'deprecated',
],
postprocess: content =>
prettier.format(content.replace('<table>', '&lt;table&gt;'), {
...prettierOpts,
parser: 'markdown',
}),
};

module.exports = config;
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ test-report.xml

sonarjs-*

packages/jsts/src/rules/*/generated-meta.ts

# IntelliJ IDEA
*.iws
*.iml
Expand Down
10 changes: 1 addition & 9 deletions generate-eslint-package-json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,14 @@ const eslintPluginDependencies = [
'@babel/preset-flow',
'@babel/preset-react',
'@eslint-community/regexpp',
'@typescript-eslint/eslint-plugin',
'@typescript-eslint/utils',
'builtin-modules',
'bytes',
'eslint-plugin-import',
'eslint-plugin-jsx-a11y',
'eslint-plugin-react',
'eslint-plugin-react-hooks',
'eslint-scope',
'functional-red-black-tree',
'jsx-ast-utils',
'minimatch',
'scslre',
'semver',
'typescript',
'vue-eslint-parser',
];

const mainPackageJson = JSON.parse(
Expand Down Expand Up @@ -90,7 +82,7 @@ await fs.writeFile(
'https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md',
dependencies,
peerDependencies: {
eslint: '8.0.0 - 9.14',
eslint: '^8.0.0 || ^9.0.0',
},
},
null,
Expand Down
1 change: 0 additions & 1 deletion its/eslint8-plugin-sonarjs/eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = [
plugin.configs.recommended,
{
rules: {
'sonarjs/accessor-pairs': 'error',
'sonarjs/no-implicit-dependencies': 'error',
},
},
Expand Down
1 change: 0 additions & 1 deletion its/eslint8-plugin-sonarjs/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default [
plugin.configs.recommended,
{
rules: {
'sonarjs/accessor-pairs': 'error',
'sonarjs/no-implicit-dependencies': 'error',
},
},
Expand Down
1 change: 0 additions & 1 deletion its/eslint8-plugin-sonarjs/tseslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import parser from '@typescript-eslint/parser';
console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules ?? {}).length} rules`);

export default tseslint.config(plugin.configs.recommended, {
rules: { 'sonarjs/accessor-pairs': 'error' },
files: ['**/*.ts'],
languageOptions: {
parser,
Expand Down
1 change: 0 additions & 1 deletion its/eslint9-plugin-sonarjs/eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = [
plugin.configs.recommended,
{
rules: {
'sonarjs/accessor-pairs': 'error',
'sonarjs/no-implicit-dependencies': 'error',
},
},
Expand Down
1 change: 0 additions & 1 deletion its/eslint9-plugin-sonarjs/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default [
plugin.configs.recommended,
{
rules: {
'sonarjs/accessor-pairs': 'error',
'sonarjs/no-implicit-dependencies': 'error',
},
},
Expand Down
1 change: 0 additions & 1 deletion its/eslint9-plugin-sonarjs/tseslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import parser from '@typescript-eslint/parser';
console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules ?? {}).length} rules`);

export default tseslint.config(plugin.configs.recommended, {
rules: { 'sonarjs/accessor-pairs': 'error' },
files: ['**/*.ts'],
languageOptions: {
parser,
Expand Down
Loading