Skip to content

Commit 09783ac

Browse files
committed
Replace deprecated tseslint.config with defineConfig
1 parent 03c32ac commit 09783ac

33 files changed

Lines changed: 126 additions & 113 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ To use the default config, follow these steps:
5757

5858
```js
5959
import javascript from '@code-pushup/eslint-config/javascript.js';
60-
import tseslint from 'typescript-eslint';
60+
import { defineConfig } from 'eslint/config';
6161

62-
export default tseslint.config(...javascript);
62+
export default defineConfig(...javascript);
6363
```
6464

6565
Depending on your tech stack, you may wish to extend other configs as well ([listed above](#⚙️-configs)). This will require installing additional peer dependencies. For more details, refer to setup docs for the configs you're interested in using.

docs/angular.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Config for **Angular** projects.
1515

1616
```js
1717
import angular from '@code-pushup/eslint-config/angular.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(
20+
export default defineConfig(
2121
...angular,
2222
{
2323
// It is recommended that selectors in Angular use a common custom prefix

docs/cypress.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Config for projects using **Cypress** for testing.
1515

1616
```js
1717
import cypress from '@code-pushup/eslint-config/cypress.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(...cypress);
20+
export default defineConfig(...cypress);
2121
```
2222

2323
## 📏 Rules (6)

docs/graphql.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ Config for **GraphQL servers** implemented in Node.js.
1515

1616
```js
1717
import graphql from '@code-pushup/eslint-config/graphql.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(...graphql);
20+
export default defineConfig(...graphql);
2121
```
2222

2323
4. The GraphQL ESLint plugin needs to know where your GraphQL schema is located. For more information, refer to [_Extended Linting Rules with GraphQL Schema_ in GraphQL ESLint docs](https://the-guild.dev/graphql/eslint/docs/getting-started#extended-linting-rules-with-graphql-schema).
2424
- If you're using [graphql-config](https://the-guild.dev/graphql/config/docs), then your GraphQL schema will be loaded automatically from your `.graphqlrc.yml` (or equivalent) file. So no extra setup is required in this case.
2525
- Otherwise, you can use [`parserOptions.schema`](https://the-guild.dev/graphql/eslint/docs/getting-started/parser-options#schema), e.g.:
2626

2727
```js
28-
export default tseslint.config(
28+
export default defineConfig(
2929
// ...
3030
{
3131
files: ['**/*.graphql'],

docs/jest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Config for projects using **Jest** for testing.
1515

1616
```js
1717
import jest from '@code-pushup/eslint-config/jest.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(
20+
export default defineConfig(
2121
...jest,
2222
{
2323
// customize rules if needed:

docs/ngrx.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Config for **Angular** projects using **NgRx** library.
1515

1616
```js
1717
import ngrx from '@code-pushup/eslint-config/ngrx.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(
20+
export default defineConfig(
2121
...ngrx,
2222
{
2323
// It is recommended that selectors in Angular use a common custom prefix

docs/node.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Config for **Node.js** projects.
1515

1616
```js
1717
import node from '@code-pushup/eslint-config/node.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(...node);
20+
export default defineConfig(...node);
2121
```
2222

2323
4. Some rules (e.g. `n/no-unsupported-features/node-builtins`) need to know which Node version is being used. Configuration options include:
@@ -35,7 +35,7 @@ Config for **Node.js** projects.
3535
- `settings.node.version` in `eslint.config.js`:
3636
3737
```js
38-
export default tseslint.config({
38+
export default defineConfig({
3939
// ...
4040
{
4141
settings: {

docs/playwright.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Config for projects using **Playwright** for testing.
1515

1616
```js
1717
import playwright from '@code-pushup/eslint-config/playwright.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(...playwright);
20+
export default defineConfig(...playwright);
2121
```
2222

2323
## 📏 Rules (42)

docs/react-testing-library.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Config for projects using **React Testing Library** for testing.
1515

1616
```js
1717
import react-testing-library from '@code-pushup/eslint-config/react-testing-library.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(...react-testing-library);
20+
export default defineConfig(...react-testing-library);
2121
```
2222

2323
## 📏 Rules (25)

docs/react.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Config for **React** projects.
1515

1616
```js
1717
import react from '@code-pushup/eslint-config/react.js';
18-
import tseslint from 'typescript-eslint';
18+
import { defineConfig } from 'eslint/config';
1919

20-
export default tseslint.config(...react);
20+
export default defineConfig(...react);
2121
```
2222

2323
## 📏 Rules (420)

0 commit comments

Comments
 (0)