Skip to content

Commit af1d4f7

Browse files
Disable 'import-x/no-rename-default' rule in ESLint config and refactor import (#32)
2 parents 0489f76 + 26edbe5 commit af1d4f7

File tree

14 files changed

+94
-3
lines changed

14 files changed

+94
-3
lines changed

.changeset/empty-banks-stay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-config': patch
3+
---
4+
5+
Add support to ignore .gitignore entries

.changeset/flat-worlds-like.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-config-next': patch
3+
---
4+
5+
Fix ESLint NextJS config

.changeset/plain-buckets-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-config-react': patch
3+
---
4+
5+
Add missing react detect version settings

.changeset/public-taxis-matter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-config-ts': patch
3+
---
4+
5+
Disable @typescript-eslint/unbound-method rule

.changeset/silly-goats-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-preset-next': patch
3+
---
4+
5+
Add .next dir to ignores

eslint.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import { nodePreset } from '@tcd-devkit/eslint-preset-node';
22

33
const config = [
44
...nodePreset,
5+
{
6+
files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
7+
rules: {
8+
'import-x/no-rename-default': ['off'],
9+
},
10+
},
511
{
612
files: ['**/tsup.config.ts', '**/tsup/**/*.ts'],
713
rules: {
@@ -20,7 +26,6 @@ const config = [
2026
'no-restricted-syntax': ['off'],
2127
'@typescript-eslint/no-unsafe-return': ['off'],
2228
'@typescript-eslint/no-unsafe-call': ['off'],
23-
'import-x/no-rename-default': ['off'],
2429
'import-x/no-deprecated': ['off'],
2530
'import-x/no-cycle': ['off'],
2631
},

packages/eslint-presets/eslint-preset-next/src/next-preset.linter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { reactHooksConfig } from '@tcd-devkit/eslint-config-react-hooks';
1111
import { tsConfig } from '@tcd-devkit/eslint-config-ts';
1212

1313
const ignoresConfig = globalIgnores(
14-
['**/dist/**', '**/node_modules/**', '**/build/**'],
14+
['**/dist/**', '**/node_modules/**', '**/build/**', '**/.next/**'],
1515
'@tcd-devkit/eslint-config/ignores',
1616
);
1717

packages/eslint/eslint-config-next/src/next.linter.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { flatConfig as nextPluginConfigs } from '@next/eslint-plugin-next';
1+
import nextPlugin from '@next/eslint-plugin-next';
22
import type { Linter } from 'eslint';
33
import { defineConfig } from 'eslint/config';
44

5+
const { flatConfig: nextPluginConfigs } = nextPlugin;
6+
57
const nextCoreWebVitals = nextPluginConfigs.coreWebVitals as Linter.Config;
68

79
export const nextConfig = defineConfig({

packages/eslint/eslint-config-react/src/react.linter.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export const reactConfig: Linter.Config[] = defineConfig({
1717
...globals.browser,
1818
},
1919
},
20+
settings: {
21+
react: {
22+
version: 'detect',
23+
},
24+
},
2025
files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
2126
rules: reactRules,
2227
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { describe, expect, it } from 'vitest';
2+
3+
import { tsRules } from '#ts.rules';
4+
import type { CustomRule } from '#ts.rules';
5+
6+
const ruleId: CustomRule = '@typescript-eslint/unbound-method';
7+
8+
describe(`${ruleId} rule`, () => {
9+
it('should have a disabled rule', () => {
10+
const ruleValue = tsRules[ruleId];
11+
12+
console.log('tsRules:', tsRules);
13+
console.log('ruleId:', ruleId);
14+
console.log('ruleValue:', ruleValue);
15+
16+
expect(ruleValue).toEqual(['off']);
17+
});
18+
});

0 commit comments

Comments
 (0)