Skip to content

Commit

Permalink
release: 1.0.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rel1cx committed Jan 26, 2024
1 parent 0542244 commit 935254e
Show file tree
Hide file tree
Showing 21 changed files with 95 additions and 74 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v1.0.0-beta.2 (Fri Jan 26 2024)

### ✨ New

- Make `dom` an alias of `react-dom` preset.
- Make `hooks` an alias of `react-hooks` preset.

## v1.0.0-beta.1 (Fri Jan 26 2024)

### ✨ New
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@

It's a platform for creating ESLint rules for not just for ReactDOM but also other libraries and frameworks that use React as a runtime.

## Why?

### What are the differences between `@eslint-react/eslint-plugin` and `eslint-plugin-react`?

The main difference is when using `@eslint-react/eslint-plugin` you can customize the behavior of the rules depending on the what render target you are using. While `eslint-plugin-react` will always assume you are using React DOM even if you are working with a project that only uses React Three Fiber.

### Is `@eslint-react/eslint-plugin` a replacement for `eslint-plugin-react`?

No, `@eslint-react/eslint-plugin` is not meant to be a drop-in replacement for `eslint-plugin-react`. But you can still using it as a replacement if you want to. Just keep in mind that some rules may behave differently, the rules provided by `@eslint-react/eslint-plugin` are designed to be more strict than `eslint-plugin-react`.

## Highlights

- Well designed rule behaviors and sensible defaults.
Expand Down Expand Up @@ -100,6 +90,14 @@ module.exports = {
Enforce recommended rules designed to catch common mistakes and prevent potential bugs.
- **recommended-type-checked-legacy** (`plugin:@eslint-react/recommended-type-checked-legacy`)\
Same as recommended-legacy but with additional rules that require type information.
- **jsx-legacy** (`plugin:@eslint-react/jsx-legacy`)\
Enable rules that are specific to JSX independently.
- **core-legacy** (`plugin:@eslint-react/core-legacy`)\
Enable rules that are specific to React independently.
- **dom-legacy** (`plugin:@eslint-react/dom-legacy`)\
Enable rules that are specific to React DOM independently.
- **hooks-legacy** (`plugin:@eslint-react/hooks-legacy`)\
Enable rules that are specific to React Hooks independently.
- **debug-legacy** (`plugin:@eslint-react/debug-legacy`)\
Enable a series of rules that are useful for debugging purposes only.\
(Not recommended unless you know what you are doing)
Expand All @@ -117,6 +115,14 @@ module.exports = {
Enforce recommended rules designed to catch common mistakes and prevent potential bugs.
- **recommended-type-checked**\
Same as recommended but with additional rules that require type information.
- **jsx**\
Enable rules that are specific to JSX independently.
- **core**\
Enable rules that are specific to React independently.
- **dom**\
Enable rules that are specific to React DOM independently.
- **hooks**\
Enable rules that are specific to React Hooks independently.
- **debug**\
Enable a series of rules that are useful for debugging purposes only.\
(Not recommended unless you know what you are doing)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-beta.1
1.0.0-beta.2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/monorepo",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "A platform for creating ESLint rules for not just for ReactDOM but also other libraries and frameworks that use React as a runtime.",
"keywords": [
"eslint",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/core",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-debug/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eslint-plugin-debug",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's ESLint plugin for debugging related rules.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-jsx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eslint-plugin-jsx",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's ESLint plugin for JSX related rules.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eslint-plugin-naming-convention",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's ESLint plugin for naming convention related rules.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eslint-plugin-react-dom",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's ESLint plugin for React DOM related rules.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eslint-plugin-react-hooks",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eslint-plugin-react",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's ESLint plugin for React related rules.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eslint-plugin",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "The main ESLint plugin of ESLint React. Contains all the rules and presets of ESLint React.",
"keywords": [
"eslint",
Expand Down
16 changes: 10 additions & 6 deletions packages/plugins/eslint-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const corePreset = {
"react/prefer-destructuring-assignment": "warn",
} as const satisfies RulePreset;

const domPreset = {
const reactDomPreset = {
"react-dom/no-dangerously-set-innerhtml": "warn",
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
"react-dom/no-find-dom-node": "error",
Expand All @@ -148,7 +148,7 @@ const domPreset = {
"react-dom/no-unsafe-target-blank": "warn",
} as const satisfies RulePreset;

const hooksPreset = {
const reactHooksPreset = {
"react-hooks/ensure-custom-hooks-using-other-hooks": "warn",
"react-hooks/ensure-use-callback-has-non-empty-deps": "warn",
"react-hooks/ensure-use-memo-has-non-empty-deps": "warn",
Expand Down Expand Up @@ -281,14 +281,18 @@ export default {
"core-legacy": createLegacyConfig(corePreset),
debug: createFlatConfig(debugPreset),
"debug-legacy": createLegacyConfig(debugPreset),
dom: createFlatConfig(domPreset),
"dom-legacy": createLegacyConfig(domPreset),
hooks: createFlatConfig(hooksPreset),
"hooks-legacy": createLegacyConfig(hooksPreset),
dom: createFlatConfig(reactDomPreset),
"dom-legacy": createLegacyConfig(reactDomPreset),
hooks: createFlatConfig(reactHooksPreset),
"hooks-legacy": createLegacyConfig(reactHooksPreset),
jsx: createFlatConfig(jsxPreset),
"jsx-legacy": createLegacyConfig(jsxPreset),
off: createFlatConfig(offPreset),
"off-legacy": createLegacyConfig(offPreset),
"react-dom": createFlatConfig(reactDomPreset),
"react-dom-legacy": createLegacyConfig(reactDomPreset),
"react-hooks": createFlatConfig(reactHooksPreset),
"react-hooks-legacy": createLegacyConfig(reactHooksPreset),
recommended: createFlatConfig(recommendedPreset),
"recommended-legacy": createLegacyConfig(recommendedPreset),
"recommended-type-checked": createFlatConfig(recommendedTypeCheckedPreset),
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/shared",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's Shared constants and functions.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/tools",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's std library and primitives.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/types",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's type definitions.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/ast/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/ast",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's TSESTree AST primitive utility module.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/jsx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/jsx",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "ESLint React's TSESTree AST utility module for static analysis of JSX.",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/var/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/var",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "TSESTree AST utility module for static analysis of variables",
"homepage": "https://github.com/rel1cx/eslint-react",
"bugs": {
Expand Down
Loading

0 comments on commit 935254e

Please sign in to comment.