Skip to content

chore(deps): update dependency eslint to v9 #920

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

Merged
merged 2 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

67 changes: 0 additions & 67 deletions .eslintrc.cjs

This file was deleted.

97 changes: 97 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { globalIgnores } from 'eslint/config';
import globals from 'globals';
import js from '@eslint/js';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import tseslint from 'typescript-eslint';

export default tseslint.config([
globalIgnores([
'benchmark/suites/',
'**/__fixtures__/',
'**/dist/',
'**/.nx/',
'**/coverage',
'**/node_modules',
]),
js.configs.recommended,
{
files: ['**/*.js', '**/*.mjs', '**/*.cjs', '**/*.ts', '**/*.tsx'],
languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 2022,
sourceType: 'module',
},

rules: {
'no-shadow': 'error',
'no-var': 'error',

'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: '*',
next: 'return',
},
{
blankLine: 'always',
prev: ['const', 'let', 'var'],
next: '*',
},
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var'],
},
{
blankLine: 'never',
prev: ['import'],
next: ['import'],
},
],

'prefer-const': 'error',
},
},
{
files: ['**/*.cjs'],

languageOptions: {
ecmaVersion: 2022,
sourceType: 'script',
},

rules: {
strict: ['error', 'global'],
},
},
{
files: ['**/*.ts', '**/*.tsx'],

extends: [
tseslint.configs.recommended,
tseslint.configs.strict,
tseslint.configs.stylistic,
],

rules: {
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',

'@typescript-eslint/array-type': [
'error',
{
default: 'array-simple',
},
],

'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/sort-type-constituents': 'error',
},
},
prettierRecommended,
]);
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
"scripts": {
"build": "nx run-many --target=build --exclude='@react-docgen-internal/*'",
"lint": "eslint . --ext .js,.cjs,.mjs,.ts,.tsx --report-unused-disable-directives --max-warnings=0",
"fix": "eslint . --ext .js,.cjs,.mjs,.ts,.tsx --fix --report-unused-disable-directives --max-warnings=0",
"lint": "eslint . --flag unstable_config_lookup_from_file --report-unused-disable-directives --max-warnings=0",
"fix": "eslint . --flag unstable_config_lookup_from_file --fix --report-unused-disable-directives --max-warnings=0",
"test": "nx run-many --target=test --exclude='@react-docgen-internal/*' --output-style=stream",
"copy:changelog:react-docgen": "cp ./packages/react-docgen/CHANGELOG.md ./packages/website/src/pages/docs/release-notes/react-docgen.mdx",
"copy:changelog:cli": "cp ./packages/react-docgen-cli/CHANGELOG.md ./packages/website/src/pages/docs/release-notes/cli.mdx",
Expand All @@ -18,22 +18,24 @@
"devDependencies": {
"@changesets/changelog-github": "0.5.1",
"@changesets/cli": "2.28.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.24.0",
"@types/node": "20.17.30",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@vitest/coverage-v8": "3.1.1",
"cpy": "11.1.0",
"eslint": "8.57.1",
"eslint": "9.24.0",
"eslint-config-next": "15.2.4",
"eslint-config-prettier": "10.1.1",
"eslint-plugin-prettier": "5.2.6",
"execa": "7.2.0",
"globals": "^16.0.0",
"nx": "20.7.1",
"prettier": "3.5.3",
"prettier-plugin-tailwindcss": "0.6.11",
"rimraf": "6.0.1",
"tempy": "3.1.0",
"typescript": "5.8.3",
"typescript-eslint": "^8.29.0",
"vitest": "3.1.1"
},
"packageManager": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-docgen/src/importer/makeFsImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default function makeFsImporter(
}
}

state.resultPath ? path.stop() : path.skip();
return state.resultPath ? path.stop() : path.skip();
},
},
ExportDefaultDeclaration: {
Expand Down
1 change: 0 additions & 1 deletion packages/react-docgen/src/utils/getMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default function getMembers(
let argumentPaths: NodePath[] = [];
let resultPath: MemberDescriptor['path'] = path as NodePath<Expression>;

// eslint-disable-next-line no-constant-condition
while (true) {
if (resultPath.isMemberExpression()) {
const property = resultPath.get('property');
Expand Down
11 changes: 0 additions & 11 deletions packages/website/.eslintrc.cjs

This file was deleted.

28 changes: 28 additions & 0 deletions packages/website/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import path from 'node:path';
import { globalIgnores } from 'eslint/config';
import { fileURLToPath } from 'node:url';
import { FlatCompat } from '@eslint/eslintrc';
import tseslint from 'typescript-eslint';
import baseConfig from '../../eslint.config.mjs';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});

export default tseslint.config([
globalIgnores(['**/.next/']),
...baseConfig,
...compat.config({
extends: ['next/core-web-vitals'],
settings: {
next: {
rootDir: __dirname,
},
},
rules: {
'import/no-anonymous-default-export': 'off',
},
}),
]);
2 changes: 1 addition & 1 deletion packages/website/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
2 changes: 1 addition & 1 deletion packages/website/src/components/ContentMissing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Callout } from 'nextra/components';
export default function ContentMissing() {
return (
<Callout emoji="ℹ️" type="info">
This content hasn't been created yet.
This content hasn&apos;t been created yet.
</Callout>
);
}
1 change: 1 addition & 0 deletions packages/website/src/components/playground/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default function Panel({
let changeHandler;

if (onChange) {
// eslint-disable-next-line react-hooks/rules-of-hooks
changeHandler = useCallback(onChange, []);
}

Expand Down
37 changes: 21 additions & 16 deletions packages/website/src/components/users/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@ interface Props {
};
}

export default ({ user }: Props) => (
<div className="box-border w-full px-4 md:w-1/3">
<a
href={user.url}
rel="noopener noreferrer"
target="_blank"
className="relative my-3.5 block h-32 rounded-md bg-white px-2.5 hover:scale-105 hover:shadow-md md:hover:scale-110 dark:bg-gray-50/10"
>
<Image
src={require(`./logos/${user.logo}`)}
alt={user.name}
className="absolute left-1/2 top-1/2 max-h-[100px] w-[128px] max-w-[200px] -translate-x-1/2 -translate-y-1/2"
/>
</a>
</div>
);
export default function User({ user }: Props) {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const logo = require(`./logos/${user.logo}`);

return (
<div className="box-border w-full px-4 md:w-1/3">
<a
href={user.url}
rel="noopener noreferrer"
target="_blank"
className="relative my-3.5 block h-32 rounded-md bg-white px-2.5 hover:scale-105 hover:shadow-md md:hover:scale-110 dark:bg-gray-50/10"
>
<Image
src={logo}
alt={user.name}
className="absolute left-1/2 top-1/2 max-h-[100px] w-[128px] max-w-[200px] -translate-x-1/2 -translate-y-1/2"
/>
</a>
</div>
);
}
20 changes: 11 additions & 9 deletions packages/website/src/components/users/UserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ interface Props {
category: string;
}

export default ({ category: filterCategory }: Props) => (
<div className="flex flex-row flex-wrap items-center justify-center rounded-md bg-gray-300 px-7 py-5 dark:bg-gray-50/10">
{users
.filter(({ category }) => category === filterCategory)
.map((user) => (
<User user={user} key={user.name} />
))}
</div>
);
export default function UserList({ category: filterCategory }: Props) {
return (
<div className="flex flex-row flex-wrap items-center justify-center rounded-md bg-gray-300 px-7 py-5 dark:bg-gray-50/10">
{users
.filter(({ category }) => category === filterCategory)
.map((user) => (
<User user={user} key={user.name} />
))}
</div>
);
}
2 changes: 2 additions & 0 deletions packages/website/src/theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const config: DocsThemeConfig = {
content: '',
},
head() {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { frontMatter, title } = useConfig();
// eslint-disable-next-line react-hooks/rules-of-hooks
const { route } = useRouter();

const description =
Expand Down
Loading
Loading