Skip to content

Commit

Permalink
fix: output rules-plugin-name @next/next instead of nextjs (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix authored Nov 6, 2024
1 parent 7961067 commit 8fba0b7
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 100 deletions.
1 change: 1 addition & 0 deletions scripts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const ignoreScope = new Set(['oxc', 'deepscan', 'security']);
export const scopeMaps = {
eslint: '',
typescript: '@typescript-eslint',
nextjs: '@next/next',
};

// Some typescript-eslint rules are re-implemented version of eslint rules.
Expand Down
120 changes: 60 additions & 60 deletions src/__snapshots__/configs.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,66 @@

exports[`contains all the oxlint rules 1`] = `
{
"@next/next/google-font-display": [
0,
],
"@next/next/google-font-preconnect": [
0,
],
"@next/next/inline-script-id": [
0,
],
"@next/next/next-script-for-ga": [
0,
],
"@next/next/no-assign-module-variable": [
0,
],
"@next/next/no-async-client-component": [
0,
],
"@next/next/no-before-interactive-script-outside-document": [
0,
],
"@next/next/no-css-tags": [
0,
],
"@next/next/no-document-import-in-page": [
0,
],
"@next/next/no-duplicate-head": [
0,
],
"@next/next/no-head-element": [
0,
],
"@next/next/no-head-import-in-document": [
0,
],
"@next/next/no-img-element": [
0,
],
"@next/next/no-page-custom-font": [
0,
],
"@next/next/no-script-component-in-head": [
0,
],
"@next/next/no-styled-jsx-in-document": [
0,
],
"@next/next/no-sync-scripts": [
0,
],
"@next/next/no-title-in-document-head": [
0,
],
"@next/next/no-typos": [
0,
],
"@next/next/no-unwanted-polyfillio": [
0,
],
"@typescript-eslint/adjacent-overload-signatures": [
0,
],
Expand Down Expand Up @@ -509,66 +569,6 @@ exports[`contains all the oxlint rules 1`] = `
"max-params": [
0,
],
"nextjs/google-font-display": [
0,
],
"nextjs/google-font-preconnect": [
0,
],
"nextjs/inline-script-id": [
0,
],
"nextjs/next-script-for-ga": [
0,
],
"nextjs/no-assign-module-variable": [
0,
],
"nextjs/no-async-client-component": [
0,
],
"nextjs/no-before-interactive-script-outside-document": [
0,
],
"nextjs/no-css-tags": [
0,
],
"nextjs/no-document-import-in-page": [
0,
],
"nextjs/no-duplicate-head": [
0,
],
"nextjs/no-head-element": [
0,
],
"nextjs/no-head-import-in-document": [
0,
],
"nextjs/no-img-element": [
0,
],
"nextjs/no-page-custom-font": [
0,
],
"nextjs/no-script-component-in-head": [
0,
],
"nextjs/no-styled-jsx-in-document": [
0,
],
"nextjs/no-sync-scripts": [
0,
],
"nextjs/no-title-in-document-head": [
0,
],
"nextjs/no-typos": [
0,
],
"nextjs/no-unwanted-polyfillio": [
0,
],
"no-alert": [
0,
],
Expand Down
1 change: 1 addition & 0 deletions src/build-from-oxlint-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import JSONCParser from 'jsonc-parser';
const scopeMaps = {
eslint: '',
typescript: '@typescript-eslint',
nextjs: '@next/next',
};

type OxlintConfigPlugins = string[];
Expand Down
40 changes: 20 additions & 20 deletions src/generated/rules-by-category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,26 +359,26 @@ const correctnessRules = {
'jsx-a11y/role-supports-aria-props': 'off',
'jsx-a11y/scope': 'off',
'jsx-a11y/tabindex-no-positive': 'off',
'nextjs/google-font-display': 'off',
'nextjs/google-font-preconnect': 'off',
'nextjs/inline-script-id': 'off',
'nextjs/next-script-for-ga': 'off',
'nextjs/no-assign-module-variable': 'off',
'nextjs/no-async-client-component': 'off',
'nextjs/no-before-interactive-script-outside-document': 'off',
'nextjs/no-css-tags': 'off',
'nextjs/no-document-import-in-page': 'off',
'nextjs/no-duplicate-head': 'off',
'nextjs/no-head-element': 'off',
'nextjs/no-head-import-in-document': 'off',
'nextjs/no-img-element': 'off',
'nextjs/no-page-custom-font': 'off',
'nextjs/no-script-component-in-head': 'off',
'nextjs/no-styled-jsx-in-document': 'off',
'nextjs/no-sync-scripts': 'off',
'nextjs/no-title-in-document-head': 'off',
'nextjs/no-typos': 'off',
'nextjs/no-unwanted-polyfillio': 'off',
'@next/next/google-font-display': 'off',
'@next/next/google-font-preconnect': 'off',
'@next/next/inline-script-id': 'off',
'@next/next/next-script-for-ga': 'off',
'@next/next/no-assign-module-variable': 'off',
'@next/next/no-async-client-component': 'off',
'@next/next/no-before-interactive-script-outside-document': 'off',
'@next/next/no-css-tags': 'off',
'@next/next/no-document-import-in-page': 'off',
'@next/next/no-duplicate-head': 'off',
'@next/next/no-head-element': 'off',
'@next/next/no-head-import-in-document': 'off',
'@next/next/no-img-element': 'off',
'@next/next/no-page-custom-font': 'off',
'@next/next/no-script-component-in-head': 'off',
'@next/next/no-styled-jsx-in-document': 'off',
'@next/next/no-sync-scripts': 'off',
'@next/next/no-title-in-document-head': 'off',
'@next/next/no-typos': 'off',
'@next/next/no-unwanted-polyfillio': 'off',
'promise/no-callback-in-promise': 'off',
'promise/no-new-statics': 'off',
'promise/valid-params': 'off',
Expand Down
40 changes: 20 additions & 20 deletions src/generated/rules-by-scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,26 +289,26 @@ const jsxA11yRules = {
} as const;

const nextjsRules = {
'nextjs/google-font-display': 'off',
'nextjs/google-font-preconnect': 'off',
'nextjs/inline-script-id': 'off',
'nextjs/next-script-for-ga': 'off',
'nextjs/no-assign-module-variable': 'off',
'nextjs/no-async-client-component': 'off',
'nextjs/no-before-interactive-script-outside-document': 'off',
'nextjs/no-css-tags': 'off',
'nextjs/no-document-import-in-page': 'off',
'nextjs/no-duplicate-head': 'off',
'nextjs/no-head-element': 'off',
'nextjs/no-head-import-in-document': 'off',
'nextjs/no-img-element': 'off',
'nextjs/no-page-custom-font': 'off',
'nextjs/no-script-component-in-head': 'off',
'nextjs/no-styled-jsx-in-document': 'off',
'nextjs/no-sync-scripts': 'off',
'nextjs/no-title-in-document-head': 'off',
'nextjs/no-typos': 'off',
'nextjs/no-unwanted-polyfillio': 'off',
'@next/next/google-font-display': 'off',
'@next/next/google-font-preconnect': 'off',
'@next/next/inline-script-id': 'off',
'@next/next/next-script-for-ga': 'off',
'@next/next/no-assign-module-variable': 'off',
'@next/next/no-async-client-component': 'off',
'@next/next/no-before-interactive-script-outside-document': 'off',
'@next/next/no-css-tags': 'off',
'@next/next/no-document-import-in-page': 'off',
'@next/next/no-duplicate-head': 'off',
'@next/next/no-head-element': 'off',
'@next/next/no-head-import-in-document': 'off',
'@next/next/no-img-element': 'off',
'@next/next/no-page-custom-font': 'off',
'@next/next/no-script-component-in-head': 'off',
'@next/next/no-styled-jsx-in-document': 'off',
'@next/next/no-sync-scripts': 'off',
'@next/next/no-title-in-document-head': 'off',
'@next/next/no-typos': 'off',
'@next/next/no-unwanted-polyfillio': 'off',
} as const;

const nodeRules = {
Expand Down

0 comments on commit 8fba0b7

Please sign in to comment.