Skip to content

Commit 409bc71

Browse files
committed
docs: replace installation docs in README.md with website urls
1 parent e3e8553 commit 409bc71

File tree

3 files changed

+7
-276
lines changed

3 files changed

+7
-276
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#### 📝 Documentation
7777

7878
- `@eslint-react/monorepo`
79+
- Add website urls to README.md
7980
- Add README.md to internal packages.
8081

8182
#### Authors: 1

README.md

Lines changed: 3 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -22,148 +22,13 @@ A set of ESLint rules to catch common mistakes and improve your React code.
2222

2323
## Installation
2424

25-
This plugin requires `typescript` and `@typescript-eslint/parser` as peer dependencies. Install them if you haven't already.
26-
27-
```bash
28-
# npm
29-
npm install --save-dev typescript @typescript-eslint/parser
30-
31-
# pnpm
32-
pnpm add --save-dev typescript @typescript-eslint/parser
33-
34-
# yarn
35-
yarn add --dev typescript @typescript-eslint/parser
36-
37-
# bun
38-
bun add --dev typescript @typescript-eslint/parser
39-
```
40-
41-
Then install this plugin.
42-
43-
```bash
44-
# npm
45-
npm install --save-dev @eslint-react/eslint-plugin
46-
47-
# pnpm
48-
pnpm add --save-dev @eslint-react/eslint-plugin
49-
50-
# yarn
51-
yarn add --dev @eslint-react/eslint-plugin
52-
53-
# bun
54-
bun add --dev @eslint-react/eslint-plugin
55-
```
56-
57-
## Usage
58-
59-
### LegacyConfig ([`.eslintrc.js`](https://eslint.org/docs/latest/use/configure/configuration-files))
60-
61-
```js
62-
module.exports = {
63-
root: true,
64-
env: { browser: true, es2021: true },
65-
parser: "@typescript-eslint/parser",
66-
extends: [
67-
"eslint:recommended",
68-
"plugin:@typescript-eslint/recommended",
69-
"plugin:react-hooks/recommended",
70-
"plugin:@eslint-react/recommended-legacy",
71-
],
72-
plugins: ["@typescript-eslint", "react-hooks"],
73-
ignorePatterns: ["dist", ".eslintrc.js"],
74-
};
75-
```
76-
77-
### FlatConfig ([`eslint.config.js`](https://eslint.org/docs/latest/use/configure/configuration-files-new))
78-
79-
```js
80-
import ts from "@typescript-eslint/eslint-plugin";
81-
import tsParser from "@typescript-eslint/parser";
82-
import react from "@eslint-react/eslint-plugin";
83-
import reactHooks from "eslint-plugin-react-hooks";
84-
85-
export default [
86-
// TypeScript rules
87-
{
88-
files: ["**/*.ts"],
89-
ignores: ["eslint.config.js"],
90-
languageOptions: {
91-
parser: tsParser,
92-
sourceType: "module",
93-
},
94-
plugins: {
95-
"@typescript-eslint": ts,
96-
},
97-
rules: {
98-
...ts.configs["eslint-recommended"].rules,
99-
...ts.configs["recommended"].rules,
100-
},
101-
},
102-
// React hooks rules
103-
{
104-
files: ["src/**/*.{ts,tsx}"],
105-
plugins: {
106-
"react-hooks": reactHooks,
107-
},
108-
rules: {
109-
...reactHooks.configs.recommended.rules,
110-
},
111-
},
112-
// React rules
113-
{
114-
files: ["src/**/*.{ts,tsx}"],
115-
...react.configs.recommended,
116-
},
117-
];
118-
```
25+
[Installation Guide ↗](https://eslint-react.rel1cx.io/docs/installation)
11926

12027
## Presets
12128

122-
> **Note:**
123-
>
124-
> **Presets with `-legacy` suffix are only available for ESLint LegacyConfig ([`.eslintrc.js`](https://eslint.org/docs/latest/use/configure/configuration-files))**.\
125-
> **Presets without `-legacy` suffix are only available for ESLint FlatConfig ([`eslint.config.js`](https://eslint.org/docs/latest/use/configure/configuration-files-new))**.
126-
>
127-
> Choose the appropriate preset based on your ESLint config format.
29+
[Presets List ↗](https://eslint-react.rel1cx.io/docs/presets)
12830

129-
> **Note:**
130-
>
131-
> **Presets with `-type-checked` or `type-checked-legacy` suffix require type information**.
132-
>
133-
> Make sure the `parserOptions.project` option is set correctly in your ESLint config when using them.
134-
135-
The following presets are available in this plugin:
136-
137-
- **recommended**\
138-
Enforce recommended rules designed to catch common mistakes and prevent potential bugs.
139-
- **recommended-legacy** (`plugin:@eslint-react/recommended-legacy`)\
140-
Same as `recommended` but for ESLint LegacyConfig.
141-
- **recommended-type-checked**\
142-
Same as `recommended` but with additional rules that require type information.
143-
- **recommended-type-checked-legacy** (`plugin:@eslint-react/recommended-type-checked-legacy`)\
144-
Same as `recommended-type-checked` but for ESLint LegacyConfig.
145-
146-
### Other presets
147-
148-
- **all**\
149-
Enable all rules in this plugin except for debug rules.\
150-
(Not recommended unless you know what you are doing)
151-
152-
- **all-legacy** (`plugin:@eslint-react/all-legacy`)\
153-
Same as `all` but for ESLint LegacyConfig.
154-
155-
- **off**\
156-
Disable all rules in this plugin except for debug rules.
157-
158-
- **off-legacy** (`plugin:@eslint-react/off-legacy`)\
159-
Same as `off` but for ESLint LegacyConfig.
160-
161-
- **debug**\
162-
Enable a series of rules that are useful for debugging purposes only.\
163-
(Not recommended unless you know what you are doing)
164-
165-
- **debug-legacy** (`plugin:@eslint-react/debug-legacy`)\
166-
Same as `debug` but for ESLint LegacyConfig.
31+
## Rules
16732

16833
[Rule List ↗](https://eslint-react.rel1cx.io/rules/overview)
16934

packages/eslint-plugin/README.md

Lines changed: 3 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -22,148 +22,13 @@ A set of ESLint rules to catch common mistakes and improve your React code.
2222

2323
## Installation
2424

25-
This plugin requires `typescript` and `@typescript-eslint/parser` as peer dependencies. Install them if you haven't already.
26-
27-
```bash
28-
# npm
29-
npm install --save-dev typescript @typescript-eslint/parser
30-
31-
# pnpm
32-
pnpm add --save-dev typescript @typescript-eslint/parser
33-
34-
# yarn
35-
yarn add --dev typescript @typescript-eslint/parser
36-
37-
# bun
38-
bun add --dev typescript @typescript-eslint/parser
39-
```
40-
41-
Then install this plugin.
42-
43-
```bash
44-
# npm
45-
npm install --save-dev @eslint-react/eslint-plugin
46-
47-
# pnpm
48-
pnpm add --save-dev @eslint-react/eslint-plugin
49-
50-
# yarn
51-
yarn add --dev @eslint-react/eslint-plugin
52-
53-
# bun
54-
bun add --dev @eslint-react/eslint-plugin
55-
```
56-
57-
## Usage
58-
59-
### LegacyConfig ([`.eslintrc.js`](https://eslint.org/docs/latest/use/configure/configuration-files))
60-
61-
```js
62-
module.exports = {
63-
root: true,
64-
env: { browser: true, es2021: true },
65-
parser: "@typescript-eslint/parser",
66-
extends: [
67-
"eslint:recommended",
68-
"plugin:@typescript-eslint/recommended",
69-
"plugin:react-hooks/recommended",
70-
"plugin:@eslint-react/recommended-legacy",
71-
],
72-
plugins: ["@typescript-eslint", "react-hooks"],
73-
ignorePatterns: ["dist", ".eslintrc.js"],
74-
};
75-
```
76-
77-
### FlatConfig ([`eslint.config.js`](https://eslint.org/docs/latest/use/configure/configuration-files-new))
78-
79-
```js
80-
import ts from "@typescript-eslint/eslint-plugin";
81-
import tsParser from "@typescript-eslint/parser";
82-
import react from "@eslint-react/eslint-plugin";
83-
import reactHooks from "eslint-plugin-react-hooks";
84-
85-
export default [
86-
// TypeScript rules
87-
{
88-
files: ["**/*.ts"],
89-
ignores: ["eslint.config.js"],
90-
languageOptions: {
91-
parser: tsParser,
92-
sourceType: "module",
93-
},
94-
plugins: {
95-
"@typescript-eslint": ts,
96-
},
97-
rules: {
98-
...ts.configs["eslint-recommended"].rules,
99-
...ts.configs["recommended"].rules,
100-
},
101-
},
102-
// React hooks rules
103-
{
104-
files: ["src/**/*.{ts,tsx}"],
105-
plugins: {
106-
"react-hooks": reactHooks,
107-
},
108-
rules: {
109-
...reactHooks.configs.recommended.rules,
110-
},
111-
},
112-
// React rules
113-
{
114-
files: ["src/**/*.{ts,tsx}"],
115-
...react.configs.recommended,
116-
},
117-
];
118-
```
25+
[Installation Guide ↗](https://eslint-react.rel1cx.io/docs/installation)
11926

12027
## Presets
12128

122-
> **Note:**
123-
>
124-
> **Presets with `-legacy` suffix are only available for ESLint LegacyConfig ([`.eslintrc.js`](https://eslint.org/docs/latest/use/configure/configuration-files))**.\
125-
> **Presets without `-legacy` suffix are only available for ESLint FlatConfig ([`eslint.config.js`](https://eslint.org/docs/latest/use/configure/configuration-files-new))**.
126-
>
127-
> Choose the appropriate preset based on your ESLint config format.
29+
[Presets List ↗](https://eslint-react.rel1cx.io/docs/presets)
12830

129-
> **Note:**
130-
>
131-
> **Presets with `-type-checked` or `type-checked-legacy` suffix require type information**.
132-
>
133-
> Make sure the `parserOptions.project` option is set correctly in your ESLint config when using them.
134-
135-
The following presets are available in this plugin:
136-
137-
- **recommended**\
138-
Enforce recommended rules designed to catch common mistakes and prevent potential bugs.
139-
- **recommended-legacy** (`plugin:@eslint-react/recommended-legacy`)\
140-
Same as `recommended` but for ESLint LegacyConfig.
141-
- **recommended-type-checked**\
142-
Same as `recommended` but with additional rules that require type information.
143-
- **recommended-type-checked-legacy** (`plugin:@eslint-react/recommended-type-checked-legacy`)\
144-
Same as `recommended-type-checked` but for ESLint LegacyConfig.
145-
146-
### Other presets
147-
148-
- **all**\
149-
Enable all rules in this plugin except for debug rules.\
150-
(Not recommended unless you know what you are doing)
151-
152-
- **all-legacy** (`plugin:@eslint-react/all-legacy`)\
153-
Same as `all` but for ESLint LegacyConfig.
154-
155-
- **off**\
156-
Disable all rules in this plugin except for debug rules.
157-
158-
- **off-legacy** (`plugin:@eslint-react/off-legacy`)\
159-
Same as `off` but for ESLint LegacyConfig.
160-
161-
- **debug**\
162-
Enable a series of rules that are useful for debugging purposes only.\
163-
(Not recommended unless you know what you are doing)
164-
165-
- **debug-legacy** (`plugin:@eslint-react/debug-legacy`)\
166-
Same as `debug` but for ESLint LegacyConfig.
31+
## Rules
16732

16833
[Rule List ↗](https://eslint-react.rel1cx.io/rules/overview)
16934

0 commit comments

Comments
 (0)