-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a917a6
commit d1d18d9
Showing
9 changed files
with
619 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
pnpm-lock.yaml | ||
pnpm-lock.yaml | ||
# handled by eslint-doc-generator | ||
README.md | ||
*/*.md |
This file contains 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,15 @@ | ||
# Contributing | ||
|
||
## Setup | ||
|
||
TODO | ||
|
||
## Documentation changes | ||
|
||
```shell | ||
pnpm run update:eslint-docs | ||
``` | ||
|
||
> [!WARNING] | ||
> Right now since there is only one rule documentation process | ||
> do not fall under any linting operation |
This file contains 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 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,55 @@ | ||
# Enforces React import style across your code. Can be customized to use default or namespace import. (`react-import/syntax`) | ||
|
||
💼 This rule is enabled in the ✅ `recommended` config. | ||
|
||
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). | ||
|
||
<!-- end auto-generated rule header --> | ||
|
||
Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
import React, { useState } from "react"; | ||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```js | ||
import * as React from "react"; | ||
``` | ||
|
||
## Options | ||
|
||
```text | ||
"react-import/syntax": [<enabled>, <'namespace' | 'default'>] | ||
``` | ||
|
||
This rule has one string options that allows to choose the preferred syntax for React imports: | ||
|
||
### `namespace` (default) | ||
|
||
```js | ||
import React, { useState } from "react"; | ||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```js | ||
import * as React from "react"; | ||
``` | ||
|
||
### `default` | ||
|
||
```js | ||
import * as React from "react"; | ||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```js | ||
import React from "react"; | ||
``` | ||
|
||
## When Not To Use It | ||
|
||
If you do not care about React import consistencies |
This file contains 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 |
---|---|---|
|
@@ -12,19 +12,27 @@ | |
"default": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"homepage": "https://github.com/marcalexiei/eslint-plugin-react-import", | ||
"keywords": [], | ||
"files": [ | ||
"dist" | ||
], | ||
"author": "Marco Pasqualetti @marcalexiei", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/marcalexiei/eslint-plugin-react-import.git" | ||
}, | ||
"scripts": { | ||
"build": "tsc -p tsconfig.build.json", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"lint": "pnpm run lint:js && eslint-doc-generator", | ||
"lint:js": "eslint .", | ||
"lint:js:fix": "eslint . --fix", | ||
"lint:docs": "eslint-doc-generator --check", | ||
"format": "prettier . --check", | ||
"format:fix": "prettier . --write", | ||
"test": "vitest" | ||
"test": "vitest", | ||
"update:eslint-docs": "pnpm run build && eslint-doc-generator" | ||
}, | ||
"packageManager": "[email protected]+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c", | ||
"devDependencies": { | ||
|
@@ -34,6 +42,7 @@ | |
"@types/node": "20.16.5", | ||
"@typescript-eslint/parser": "8.6.0", | ||
"eslint": "9.10.0", | ||
"eslint-doc-generator": "1.7.1", | ||
"eslint-plugin-eslint-plugin": "6.2.0", | ||
"eslint-plugin-n": "17.10.2", | ||
"prettier": "3.3.3", | ||
|
Oops, something went wrong.