Skip to content

Commit

Permalink
fix: detect rules with plugin alias name or no plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Nov 7, 2024
1 parent 27327df commit ab59bce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/build-from-oxlint-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('buildFromOxlintConfig', () => {
});

// look here: <https://github.com/oxc-project/oxc/blob/0b329516372a0353e9eb18e5bc0fbe63bce21fee/crates/oxc_linter/src/config/rules.rs#L285>
it.only('detect oxlint rules with plugin alias inside rules block', () => {
it('detect oxlint rules with plugin alias inside rules block', () => {
const rules = buildFromOxlintConfig({
rules: {
'eslint/eqeqeq': 'warn',
Expand Down
4 changes: 2 additions & 2 deletions src/build-from-oxlint-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import JSONCParser from 'jsonc-parser';
// only used for the scopes where the directory structure doesn't reflect the eslint scope
// such as `typescript` vs `@typescript-eslint` or others. Eslint as a scope is an exception,
// as eslint doesn't have a scope.
// There is a duplicate in scripts/constants.js, for clean builds we manage it in 2 files.
// In the future we can generate maybe this constant into src folder
// look here: <https://github.com/oxc-project/oxc/blob/0b329516372a0353e9eb18e5bc0fbe63bce21fee/crates/oxc_linter/src/config/rules.rs#L285>
const aliasPluginNames: Record<string, string> = {
eslint: '',
typescript: '@typescript-eslint',
nextjs: '@next/next',

// only in build-config
react_perf: 'react-perf',
jsx_a11y: 'jsx-a11y',
};

const allRulesObjects = Object.values(configByCategory).map(
Expand Down

0 comments on commit ab59bce

Please sign in to comment.