-
-
Notifications
You must be signed in to change notification settings - Fork 27
Add strict presets #1266
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
Add strict presets #1266
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6d5bba5
Add strict config presets
Rel1cx a0760f2
Add strict presets and reorganize config files
Rel1cx 1ebcb53
Merge branch 'main' into add-strict-presets
Rel1cx f088f34
Merge branch 'main' into add-strict-presets
Rel1cx 7882773
Mark beta presets in ESLint React docs
Rel1cx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { RuleConfig } from "@eslint-react/kit"; | ||
|
||
export const rules = { | ||
"@eslint-react/no-leaked-conditional-rendering": "warn", | ||
"@eslint-react/no-unused-props": "warn", | ||
} as const satisfies Record<string, RuleConfig>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { RuleConfig } from "@eslint-react/kit"; | ||
|
||
export const rules = { | ||
"@eslint-react/dom/no-string-style-prop": "off", | ||
"@eslint-react/dom/no-unknown-property": "off", | ||
"@eslint-react/jsx-no-duplicate-props": "off", | ||
"@eslint-react/jsx-uses-react": "off", | ||
"@eslint-react/jsx-uses-vars": "off", | ||
} as const satisfies Record<string, RuleConfig>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/plugins/eslint-plugin/src/configs/recommended-type-checked.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 2 additions & 5 deletions
7
packages/plugins/eslint-plugin/src/configs/recommended-typescript.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/plugins/eslint-plugin/src/configs/strict-type-checked.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { RuleConfig } from "@eslint-react/kit"; | ||
|
||
import * as tc from "./_tc"; | ||
import * as strictTypeScript from "./strict-typescript"; | ||
|
||
export const name = "@eslint-react/strict-type-checked"; | ||
|
||
export const rules = { | ||
...strictTypeScript.rules, | ||
...tc.rules, | ||
} as const satisfies Record<string, RuleConfig>; | ||
|
||
export const plugins = { | ||
...strictTypeScript.plugins, | ||
}; | ||
|
||
export const settings = { | ||
...strictTypeScript.settings, | ||
}; |
19 changes: 19 additions & 0 deletions
19
packages/plugins/eslint-plugin/src/configs/strict-typescript.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { RuleConfig } from "@eslint-react/kit"; | ||
|
||
import * as ts from "./recommended-typescript"; | ||
import * as strict from "./strict"; | ||
|
||
export const name = "@eslint-react/strict-typescript"; | ||
|
||
export const rules = { | ||
...strict.rules, | ||
...ts.rules, | ||
} as const satisfies Record<string, RuleConfig>; | ||
|
||
export const plugins = { | ||
...strict.plugins, | ||
}; | ||
|
||
export const settings = { | ||
...strict.settings, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { RuleConfig } from "@eslint-react/kit"; | ||
|
||
import * as recommended from "./recommended"; | ||
|
||
export const name = "@eslint-react/strict"; | ||
|
||
export const rules = { | ||
...recommended.rules, | ||
"@eslint-react/jsx-no-iife": "error", | ||
"@eslint-react/jsx-no-undef": "error", | ||
"@eslint-react/no-children-prop": "warn", | ||
"@eslint-react/no-class-component": "error", | ||
"@eslint-react/no-misused-capture-owner-stack": "error", | ||
"@eslint-react/no-unnecessary-key": "warn", | ||
"@eslint-react/no-unnecessary-use-callback": "warn", | ||
"@eslint-react/no-unnecessary-use-memo": "warn", | ||
"@eslint-react/no-unstable-context-value": "warn", | ||
"@eslint-react/no-unstable-default-props": "warn", | ||
"@eslint-react/no-unused-props": "warn", | ||
"@eslint-react/no-unused-state": "warn", | ||
"@eslint-react/no-useless-fragment": "warn", | ||
"@eslint-react/prefer-destructuring-assignment": "warn", | ||
|
||
"@eslint-react/dom/no-missing-button-type": "warn", | ||
"@eslint-react/dom/no-missing-iframe-sandbox": "warn", | ||
"@eslint-react/dom/no-unsafe-target-blank": "warn", | ||
} as const satisfies Record<string, RuleConfig>; | ||
|
||
export const plugins = { | ||
...recommended.plugins, | ||
}; | ||
|
||
export const settings = { | ||
...recommended.settings, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.