Skip to content

Commit 775e3a9

Browse files
committed
@dephub/eslint-react@1.0.0
0 parents  commit 775e3a9

File tree

14 files changed

+4746
-0
lines changed

14 files changed

+4746
-0
lines changed

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Publishes the package to npm when a version tag (v*) is pushed.
2+
# Skips publishing if the exact version already exists.
3+
name: Publish Package to npmjs
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
id-token: write
16+
17+
steps:
18+
- uses: actions/checkout@v5
19+
20+
- name: Enable Corepack
21+
run: corepack enable
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '20.x'
26+
registry-url: 'https://registry.npmjs.org'
27+
cache: 'pnpm'
28+
29+
- name: Check if version exists
30+
id: version
31+
run: |
32+
LOCAL_VERSION=$(node -p "require('./package.json').version")
33+
PACKAGE_NAME=$(node -p "require('./package.json').name")
34+
35+
if npm view $PACKAGE_NAME@$LOCAL_VERSION version >/dev/null 2>&1; then
36+
echo "exists=true" >> $GITHUB_OUTPUT
37+
else
38+
echo "exists=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Install dependencies
42+
if: steps.version.outputs.exists == 'false'
43+
run: pnpm install --frozen-lockfile
44+
45+
- name: Publish
46+
if: steps.version.outputs.exists == 'false'
47+
run: pnpm publish --provenance --access public --no-git-checks
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/node_modules
2+
/dist
3+
/temp
4+
/playground
5+
/.pnp
6+
.pnp.js
7+
/coverage
8+
/out/
9+
.DS_Store
10+
*.pem
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
.pnpm-debug.log*
15+
.env*.local
16+
/temp

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"jsxSingleQuote": true,
5+
"trailingComma": "all",
6+
"printWidth": 80,
7+
"tabWidth": 2
8+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MIT License
2+
3+
Copyright (c) 2025-2026 Estarlin R
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
PR = pnpm run
2+
3+
r:
4+
$(PR) release
5+
m:
6+
lineo md 'src/**/*.ts' --outFile code.md --outDir temp
7+
t:
8+
$(PR) check-types
9+
l:
10+
$(PR) lint
11+
c:
12+
$(PR) clean
13+
b:
14+
$(PR) build
15+
d:
16+
$(PR) dev
17+
p:
18+
$(PR) pack
19+
s:
20+
$(PR) start $(ARGS)

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# @dephub/eslint-react ⚛️
2+
3+
> Opinionated modern ESLint configuration for React projects, built on top of `@dephub/eslint-ts`.
4+
5+
[![NPM version](https://img.shields.io/npm/v/@dephub/eslint-react.svg?style=flat)](https://npmjs.org/package/@dephub/eslint-react)
6+
[![ESM-only](https://img.shields.io/badge/ESM-only-brightgreen?style=flat)](https://nodejs.org/)
7+
8+
---
9+
10+
## Features ✨
11+
12+
- ⚛️ Extends `@dephub/eslint-ts` for full TS + React support
13+
- 🧠 React and React Hooks best practices
14+
- 🟦 Strict TypeScript rules included
15+
- 🔀 Import sorting and unused import handling
16+
- 🧹 Prettier-compatible formatting rules
17+
18+
---
19+
20+
## Installation 📦
21+
22+
- npm: `npm install -D eslint @dephub/eslint-react`
23+
- pnpm: `pnpm add -D eslint @dephub/eslint-react`
24+
- yarn: `yarn add -D eslint @dephub/eslint-react`
25+
- bun: `bun add -D eslint @dephub/eslint-react`
26+
27+
> Since this config extends `@dephub/eslint-ts`, make sure your project is configured for TypeScript.
28+
29+
---
30+
31+
## Usage 🎯
32+
33+
### API 🧩
34+
35+
Create an `eslint.config.mjs` file:
36+
37+
```ts id="reactcfg"
38+
import { defineConfig } from 'eslint/config';
39+
import reactConfig from '@dephub/eslint-react';
40+
41+
export default defineConfig(reactConfig);
42+
```
43+
44+
You don’t need to manually include `@dephub/eslint-ts` — it’s already extended internally.
45+
46+
### Extending the configuration
47+
48+
```ts id="reactext"
49+
import { defineConfig } from 'eslint/config';
50+
import reactConfig from '@dephub/eslint-react';
51+
52+
export default defineConfig([
53+
...reactConfig,
54+
{
55+
rules: {
56+
'react/react-in-jsx-scope': 'off',
57+
},
58+
},
59+
]);
60+
```
61+
62+
Then run ESLint normally:
63+
64+
```bash id="reactrun"
65+
npx eslint .
66+
```
67+
68+
---
69+
70+
## License 📄
71+
72+
MIT License – see [LICENSE](LICENSE) for details.
73+
74+
**Author:** Estarlin R ([estarlincito.com](https://estarlincito.com))

eslint.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import tsConfig from '@dephub/eslint-ts';
2+
import { defineConfig } from 'eslint/config';
3+
4+
export default defineConfig(tsConfig);

package.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"name": "@dephub/eslint-react",
3+
"type": "module",
4+
"version": "1.0.0",
5+
"description": "Opinionated modern ESLint configuration for React projects.",
6+
"types": "./dist/index.d.ts",
7+
"main": "./dist/index.js",
8+
"scripts": {
9+
"prepublishOnly": "pnpm clean && pnpm check-types && pnpm build && pnpm lint",
10+
"release": "pnpm publish",
11+
"check-types": "tsc --noEmit",
12+
"lint": "eslint . --fix --max-warnings 0",
13+
"clean": "rm -rf dist",
14+
"build": "vite build",
15+
"dev": "vite build -w"
16+
},
17+
"keywords": [
18+
"eslint-react",
19+
"lint",
20+
"eslint",
21+
"eslint-config",
22+
"react",
23+
"typescript",
24+
"ts",
25+
"config",
26+
"preset",
27+
"linter",
28+
"code-quality"
29+
],
30+
"author": {
31+
"name": "Estarlin R",
32+
"email": "dev@estarlincito.com",
33+
"url": "https://estarlincito.com"
34+
},
35+
"files": [
36+
"LICENSE",
37+
"README.md",
38+
"dist"
39+
],
40+
"license": "MIT",
41+
"homepage": "https://github.com/dephub-js/eslint-react#readme",
42+
"repository": {
43+
"type": "git",
44+
"url": "https://github.com/dephub-js/eslint-react.git"
45+
},
46+
"bugs": {
47+
"url": "https://github.com/dephub-js/eslint-react/issues"
48+
},
49+
"publishConfig": {
50+
"access": "public"
51+
},
52+
"packageManager": "pnpm@10.30.3",
53+
"dependencies": {
54+
"@dephub/eslint-ts": "^1.0.1",
55+
"@types/eslint": "^9.6.1",
56+
"eslint": "^10.0.2",
57+
"eslint-plugin-react": "^7.37.5",
58+
"eslint-plugin-react-hooks": "^7.0.1"
59+
},
60+
"devDependencies": {
61+
"@dephub/glob": "^1.0.1",
62+
"@dephub/path": "^1.0.1",
63+
"@types/node": "^25.3.2",
64+
"typescript": "^5.9.3",
65+
"vite": "^7.3.1",
66+
"vite-plugin-dts": "^4.5.4"
67+
}
68+
}

0 commit comments

Comments
 (0)