Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d7517b

Browse files
Merge branch 'main'
2 parents 695f1bb + 6861313 commit 8d7517b

File tree

13 files changed

+843
-1069
lines changed

13 files changed

+843
-1069
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# typescript-eslint Examples
22

33
Various examples of working with typescript-eslint. 📝
4-
We may add to this over time, or we may get rid of it in favor of [typescript-eslint.io](https://typescript-eslint.io).
5-
We'll see.
4+
5+
| Example | Use Case |
6+
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
7+
| [`eslint-plugin-example-typed-linting`](./examples/eslint-plugin-example-typed-linting) | ESLint plugin showing typed linting with `@typescript-eslint/utils`. |
8+
| [`flat-config-disable-type-checked`](./examples/flat-config-disable-type-checked) | Linting TypeScript code with type information, disabling typed rules on `*.js` files. |
9+
| [`flat-config-typed`](./examples/flat-config-typed) | Linting TypeScript code with type information using Project Service. |
10+
| [`flat-config-typed-tsconfig`](./examples/flat-config-typed-tsconfig) | Linting TypeScript code with type information and a `tsconfig.eslint.json`. |
11+
| [`flat-config-untyped`](./examples/flat-config-untyped) | Linting TypeScript code without type information. |
12+
| [`node-test-floating-promises`](./examples/node-test-floating-promises) | Using `node:test` along the `@typescript-eslint/no-floating-promises` `allowForKnownSafeCalls` option. |
13+
| [`typed-rule-via-linter`](./examples/typed-rule-via-linter) | Running a single typed rule via ESLint's `Linter` class. |
14+
| [`typescript-estree-standalone`](./examples/typescript-estree-standalone) | Using the `@typescript-eslint/estree` package to generate an AST standalone (without ESLint). |

package-lock.json

Lines changed: 792 additions & 1021 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/eslint-plugin-example-typed-linting/package.json

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
{
22
"dependencies": {
3-
"@typescript-eslint/utils": "8.18.0"
3+
"@typescript-eslint/utils": "8.32.1"
44
},
55
"devDependencies": {
6-
"@eslint/js": "^9.16.0",
7-
"@types/eslint": "^9.6.1",
8-
"@types/eslint__js": "^8.42.3",
9-
"@types/node": "^22.10.2",
10-
"@typescript-eslint/rule-tester": "8.18.0",
11-
"eslint": "^9.16.0",
12-
"eslint-doc-generator": "^2.0.0",
13-
"eslint-plugin-eslint-plugin": "^6.3.2",
14-
"typescript": "^5.7.2",
15-
"typescript-eslint": "8.18.0",
16-
"vitest": "^2.1.8"
6+
"@eslint/js": "^9.27.0",
7+
"@types/node": "^22.15.21",
8+
"@typescript-eslint/rule-tester": "8.32.1",
9+
"eslint": "^9.27.0",
10+
"eslint-doc-generator": "^2.1.2",
11+
"eslint-plugin-eslint-plugin": "^6.4.0",
12+
"typescript": "^5.8.3",
13+
"typescript-eslint": "8.32.1",
14+
"vitest": "^3.1.4"
1715
},
1816
"exports": {
1917
".": {

packages/flat-config-disable-type-checked/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Example: Flat Config and disable-type-checked
22

3-
An example of using the [`typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint) package to lint TypeScript code with type information.
3+
An example of using the [`typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint) package to lint TypeScript code with type information, disabling type checked rules on `*.js` files.
44

55
## Setup
66

packages/flat-config-disable-type-checked/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
},
1111
"license": "MIT",
1212
"devDependencies": {
13-
"@types/eslint": "^9.6.1",
14-
"eslint": "^9.16.0",
15-
"typescript": "^5.7.2",
16-
"typescript-eslint": "^8.18.0"
13+
"eslint": "^9.27.0",
14+
"typescript": "^5.8.3",
15+
"typescript-eslint": "^8.32.1"
1716
},
1817
"scripts": {
1918
"lint": "eslint .",

packages/flat-config-typed-tsconfig/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@
1010
},
1111
"license": "MIT",
1212
"devDependencies": {
13-
"@types/eslint": "^9.6.1",
14-
"@types/eslint__js": "^8.42.3",
15-
"eslint": "^9.16.0",
16-
"typescript": "^5.7.2",
17-
"typescript-eslint": "^8.18.0"
13+
"typescript": "^5.8.3",
14+
"typescript-eslint": "^8.32.1"
1815
},
1916
"scripts": {
2017
"lint": "eslint .",

packages/flat-config-typed/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Example: Flat Config (Typed)
22

3-
An example of using the [`typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint) package to lint TypeScript code with type information.
3+
An example of using the [`typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint) package to lint TypeScript code with type information using Project Service.
44

55
## Setup
66

packages/flat-config-typed/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
},
1111
"license": "MIT",
1212
"devDependencies": {
13-
"@types/eslint": "^9.6.1",
14-
"eslint": "^9.16.0",
15-
"typescript": "^5.7.2",
16-
"typescript-eslint": "^8.18.0"
13+
"eslint": "^9.27.0",
14+
"typescript": "^5.8.3",
15+
"typescript-eslint": "^8.32.1"
1716
},
1817
"scripts": {
1918
"lint": "eslint src",

packages/flat-config-untyped/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
},
1111
"license": "MIT",
1212
"devDependencies": {
13-
"typescript-eslint": "^8.18.0",
14-
"typescript": "^5.7.2",
15-
"eslint": "^9.16.0"
13+
"typescript-eslint": "^8.32.1",
14+
"typescript": "^5.8.3",
15+
"eslint": "^9.27.0"
1616
},
1717
"scripts": {
1818
"lint": "eslint src",

packages/node-test-floating-promises/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
},
1111
"license": "MIT",
1212
"devDependencies": {
13-
"@types/node": "^22.10.7",
14-
"eslint": "^9.16.0",
15-
"typescript": "^5.7.2",
16-
"typescript-eslint": "^8.18.0"
13+
"@types/node": "^22.15.21",
14+
"eslint": "^9.27.0",
15+
"typescript": "^5.8.3",
16+
"typescript-eslint": "^8.32.1"
1717
},
1818
"scripts": {
1919
"lint": "eslint .",

packages/typed-rule-via-linter/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
},
1111
"license": "MIT",
1212
"dependencies": {
13-
"@typescript-eslint/parser": "^8.18.0",
14-
"@typescript-eslint/utils": "^8.18.0",
15-
"eslint": "^9.16.0",
16-
"typescript": "^5.7.2"
13+
"@typescript-eslint/parser": "^8.32.1",
14+
"@typescript-eslint/utils": "^8.32.1",
15+
"eslint": "^9.27.0",
16+
"typescript": "^5.8.3"
1717
},
1818
"devDependencies": {
19-
"@types/eslint": "^9.6.1",
20-
"tsx": "^4.19.2"
19+
"tsx": "^4.19.4"
2120
},
2221
"scripts": {
2322
"example": "tsx index.ts"

packages/typescript-estree-standalone/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import ts from "typescript";
66
const { ast, services } = tsESTree.parseAndGenerateServices(
77
`const hello = 'world';`,
88
{
9-
EXPERIMENTAL_useProjectService: true,
9+
projectService: {
10+
allowDefaultProject: ['estree.ts']
11+
},
1012
}
1113
);
1214

packages/typescript-estree-standalone/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
},
1111
"license": "MIT",
1212
"dependencies": {
13-
"@typescript-eslint/typescript-estree": "^8.18.0",
14-
"ts-api-utils": "^2.0.0",
15-
"typescript": "^5.7.2"
13+
"@typescript-eslint/typescript-estree": "^8.32.1",
14+
"ts-api-utils": "^2.1.0",
15+
"typescript": "^5.8.3"
1616
},
1717
"devDependencies": {
18-
"@types/node": "^22.10.2",
19-
"tsx": "^4.19.2"
18+
"@types/node": "^22.15.21",
19+
"tsx": "^4.19.4"
2020
},
2121
"scripts": {
2222
"example": "tsx index.ts"

0 commit comments

Comments
 (0)