Skip to content

Commit

Permalink
refactor: move generated code into own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Nov 5, 2024
1 parent 20978f1 commit b8ecd9c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion scripts/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const configGenerator = new ConfigGenerator(successResultArray);

const generateFolder = path.resolve(__dirname, '..', `src/generated`);

fs.mkdirSync(generateFolder);
if (!fs.existsSync(generateFolder)) {
fs.mkdirSync(generateFolder);
}

for (const generator of [rulesGenerator, configGenerator]) {
generator.setRulesGrouping(RulesGrouping.SCOPE);
await generator.generateRules(generateFolder);
Expand Down
1 change: 0 additions & 1 deletion src/__snapshots__/build-from-oxlint-config.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ exports[`buildFromOxlintConfig > default plugins (react, unicorn, typescript), d
"no-useless-escape": "off",
"no-useless-rename": "off",
"no-with": "off",
"react/iframe-missing-sandbox": "off",
"react/jsx-key": "off",
"react/jsx-no-duplicate-props": "off",
"react/jsx-no-target-blank": "off",
Expand Down
6 changes: 5 additions & 1 deletion src/generated/rules-by-category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ const restrictionRules = {
'no-void': 'off',
'unicode-bom': 'off',
'import/no-amd': 'off',
'import/no-commonjs': 'off',
'import/no-cycle': 'off',
'import/no-default-export': 'off',
'import/no-dynamic-require': 'off',
'import/no-webpack-loader-syntax': 'off',
'jsdoc/check-access': 'off',
'jsdoc/empty-tags': 'off',
'node/no-new-require': 'off',
'promise/catch-or-return': 'off',
'promise/spec-only': 'off',
'react/button-has-type': 'off',
Expand Down Expand Up @@ -166,6 +168,7 @@ const styleRules = {
'no-ternary': 'off',
'prefer-exponentiation-operator': 'off',
'prefer-numeric-literals': 'off',
'prefer-object-has-own': 'off',
'sort-imports': 'off',
'sort-keys': 'off',
'jest/consistent-test-it': 'off',
Expand Down Expand Up @@ -379,7 +382,6 @@ const correctnessRules = {
'promise/no-callback-in-promise': 'off',
'promise/no-new-statics': 'off',
'promise/valid-params': 'off',
'react/iframe-missing-sandbox': 'off',
'react/jsx-key': 'off',
'react/jsx-no-duplicate-props': 'off',
'react/jsx-no-target-blank': 'off',
Expand Down Expand Up @@ -440,8 +442,10 @@ const suspiciousRules = {
'import/no-named-as-default-member': 'off',
'import/no-self-import': 'off',
'jest/no-commented-out-tests': 'off',
'react/iframe-missing-sandbox': 'off',
'react/jsx-no-comment-textnodes': 'off',
'react/react-in-jsx-scope': 'off',
'react/style-prop-object': 'off',
'@typescript-eslint/no-confusing-non-null-assertion': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
Expand Down
4 changes: 4 additions & 0 deletions src/generated/rules-by-scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const eslintRules = {
'no-with': 'off',
'prefer-exponentiation-operator': 'off',
'prefer-numeric-literals': 'off',
'prefer-object-has-own': 'off',
radix: 'off',
'require-await': 'off',
'require-yield': 'off',
Expand Down Expand Up @@ -172,6 +173,7 @@ const importRules = {
'import/named': 'off',
'import/namespace': 'off',
'import/no-amd': 'off',
'import/no-commonjs': 'off',
'import/no-cycle': 'off',
'import/no-default-export': 'off',
'import/no-deprecated': 'off',
Expand Down Expand Up @@ -311,6 +313,7 @@ const nextjsRules = {

const nodeRules = {
'node/no-exports-assign': 'off',
'node/no-new-require': 'off',
} as const;

const promiseRules = {
Expand Down Expand Up @@ -355,6 +358,7 @@ const reactRules = {
'react/require-render-return': 'off',
'react/rules-of-hooks': 'off',
'react/self-closing-comp': 'off',
'react/style-prop-object': 'off',
'react/void-dom-elements-no-children': 'off',
} as const;

Expand Down

0 comments on commit b8ecd9c

Please sign in to comment.