@aristobyte-ui/eslint-config 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/dist/eslint.base.js +18 -0
- package/dist/eslint.next.js +42 -0
- package/dist/eslint.react.js +33 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @aristobyte-ui/eslint-config
|
|
2
|
+
|
|
3
|
+
Scalable, modular, and shareable ESLint configurations for AristoByte’s modern TypeScript/JavaScript monorepos.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🔧 Overview
|
|
8
|
+
|
|
9
|
+
This package delivers a suite of opinionated ESLint configurations, designed to enforce code quality, consistency, and developer efficiency across the AristoByte ecosystem. Powered by ESLint Flat Config and aligned with monorepo-first tooling like TurboRepo and Prettier, it enables fast, frictionless linting with a single source of truth.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 📦 Exported Config Profiles
|
|
14
|
+
|
|
15
|
+
| Config Path | Description |
|
|
16
|
+
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `@aristobyte-ui/eslint-config/base` | Core ruleset for JS/TS projects. Includes Prettier formatting, TurboRepo support, and `eslint-plugin-only-warn`. |
|
|
18
|
+
| `@aristobyte-ui/eslint-config/react` | Optimized for internal React component libraries with hooks and JSX best practices. |
|
|
19
|
+
| `@aristobyte-ui/eslint-config/next` | Tailored specifically for Next.js applications, aligned with Next’s linting expectations. |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🚀 Quick Start
|
|
24
|
+
|
|
25
|
+
### 1. Install the Config Package & Peer Dependencies
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn add -D eslint @aristobyte-ui/eslint-config
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
You may also need to install peer dependencies such as:
|
|
32
|
+
|
|
33
|
+
- `prettier`
|
|
34
|
+
- `eslint-plugin-react`
|
|
35
|
+
- `*eslint-plugin-import`
|
|
36
|
+
- `eslint-plugin-jsx-a11y`
|
|
37
|
+
- `eslint-plugin-react-hooks`
|
|
38
|
+
- `eslint-plugin-turbo`
|
|
39
|
+
- `eslint-plugin-only-warn`
|
|
40
|
+
|
|
41
|
+
### 2. Configure Your ESLint Flat Config (eslint.config.js)
|
|
42
|
+
|
|
43
|
+
Example for a React package:
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
import base from "@aristobyte-ui/eslint-config/base";
|
|
47
|
+
import react from "@aristobyte-ui/eslint-config/react";
|
|
48
|
+
|
|
49
|
+
export default [...base, ...react];
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or for a Next.js app:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
import base from "@aristobyte-ui/eslint-config/base";
|
|
56
|
+
import next from "@aristobyte-ui/eslint-config/next";
|
|
57
|
+
|
|
58
|
+
export default [...base, ...next];
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 💡 Why Use This?
|
|
62
|
+
|
|
63
|
+
- Single Source of Linting Truth across projects.
|
|
64
|
+
- Pre-optimized rules for React, Next.js, and monorepo workflows.
|
|
65
|
+
- Flat Config architecture for modern ESLint performance and flexibility.
|
|
66
|
+
- First-class Prettier integration with zero conflicts.
|
|
67
|
+
- TurboRepo-friendly — supports parallelized linting out of the box.
|
|
68
|
+
|
|
69
|
+
## 🤝 Contribution
|
|
70
|
+
|
|
71
|
+
Feel free to extend or override specific configs as your project requirements evolve. PRs are welcome for additional presets or plugin integrations.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
© AristoByte Inc. — Enforcing code excellence at scale.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
import turboPlugin from "eslint-plugin-turbo";
|
|
4
|
+
import tseslint from "typescript-eslint";
|
|
5
|
+
import onlyWarn from "eslint-plugin-only-warn";
|
|
6
|
+
export const config = [
|
|
7
|
+
js.configs.recommended,
|
|
8
|
+
eslintConfigPrettier,
|
|
9
|
+
...tseslint.configs.recommended,
|
|
10
|
+
{
|
|
11
|
+
plugins: { turbo: turboPlugin },
|
|
12
|
+
rules: {
|
|
13
|
+
"turbo/no-undeclared-env-vars": "warn",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{ plugins: { onlyWarn } },
|
|
17
|
+
{ ignores: ["dist/**"] },
|
|
18
|
+
];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import pluginReact from "eslint-plugin-react";
|
|
5
|
+
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
6
|
+
import pluginNext from "@next/eslint-plugin-next";
|
|
7
|
+
import globals from "globals";
|
|
8
|
+
import { config as baseConfig } from "./eslint.base.js";
|
|
9
|
+
export const nextJsConfig = [
|
|
10
|
+
...baseConfig,
|
|
11
|
+
js.configs.recommended,
|
|
12
|
+
eslintConfigPrettier,
|
|
13
|
+
...tseslint.configs.recommended,
|
|
14
|
+
{
|
|
15
|
+
...pluginReact.configs.flat.recommended,
|
|
16
|
+
languageOptions: {
|
|
17
|
+
...pluginReact.configs.flat.recommended.languageOptions,
|
|
18
|
+
globals: {
|
|
19
|
+
...globals.serviceworker,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
plugins: {
|
|
25
|
+
"@next/next": pluginNext,
|
|
26
|
+
},
|
|
27
|
+
rules: {
|
|
28
|
+
...pluginNext.configs.recommended.rules,
|
|
29
|
+
...pluginNext.configs["core-web-vitals"].rules,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
plugins: {
|
|
34
|
+
"react-hooks": pluginReactHooks,
|
|
35
|
+
},
|
|
36
|
+
settings: { react: { version: "detect" } },
|
|
37
|
+
rules: {
|
|
38
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
39
|
+
"react/react-in-jsx-scope": "off",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import pluginReact from "eslint-plugin-react";
|
|
5
|
+
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
6
|
+
import globals from "globals";
|
|
7
|
+
import { config as baseConfig } from "./eslint.base.js";
|
|
8
|
+
export const config = [
|
|
9
|
+
...baseConfig,
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
eslintConfigPrettier,
|
|
12
|
+
...tseslint.configs.recommended,
|
|
13
|
+
pluginReact.configs.flat.recommended,
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
...pluginReact.configs.flat.recommended.languageOptions,
|
|
17
|
+
globals: {
|
|
18
|
+
...globals.serviceworker,
|
|
19
|
+
...globals.browser,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
plugins: {
|
|
25
|
+
"react-hooks": pluginReactHooks,
|
|
26
|
+
},
|
|
27
|
+
settings: { react: { version: "detect" } },
|
|
28
|
+
rules: {
|
|
29
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
30
|
+
"react/react-in-jsx-scope": "off",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aristobyte-ui/eslint-config",
|
|
3
|
+
"description": "AristoByteUI ESLint config presets for base, Next.js, and React-based packages.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"author": "AristoByte <info@aristobyte.com>",
|
|
10
|
+
"homepage": "https://github.com/aristobyte-team/aristobyte-ui.git#readme",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/aristobyte-team/aristobyte-ui.git",
|
|
14
|
+
"directory": "packages/eslint-config"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/aristobyte-team/aristobyte-ui.git/issues"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20.17.0",
|
|
21
|
+
"npm": ">=10.8.2",
|
|
22
|
+
"yarn": ">=1.22.22"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"eslint",
|
|
26
|
+
"config",
|
|
27
|
+
"typescript",
|
|
28
|
+
"nextjs",
|
|
29
|
+
"react",
|
|
30
|
+
"aristobyte",
|
|
31
|
+
"aristobyte-ui"
|
|
32
|
+
],
|
|
33
|
+
"exports": {
|
|
34
|
+
"./base": "./dist/eslint.base.js",
|
|
35
|
+
"./react": "./dist/eslint.react.js",
|
|
36
|
+
"./next": "./dist/eslint.next.js"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc --project tsconfig.json"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"eslint": "^9.0.0",
|
|
46
|
+
"typescript": "^5.0.0",
|
|
47
|
+
"eslint-plugin-react": "^7.37.4",
|
|
48
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
49
|
+
"@next/eslint-plugin-next": "^15.3.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@eslint/js": "^9.27.0",
|
|
53
|
+
"@next/eslint-plugin-next": "^15.3.0",
|
|
54
|
+
"@types/node": "^22.15.24",
|
|
55
|
+
"eslint": "^9.27.0",
|
|
56
|
+
"eslint-config-prettier": "^10.1.1",
|
|
57
|
+
"eslint-plugin-only-warn": "^1.1.0",
|
|
58
|
+
"eslint-plugin-react": "^7.37.4",
|
|
59
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
60
|
+
"eslint-plugin-turbo": "^2.5.0",
|
|
61
|
+
"globals": "^16.2.0",
|
|
62
|
+
"ts-node": "^10.9.2",
|
|
63
|
+
"typescript": "^5.8.2",
|
|
64
|
+
"typescript-eslint": "^8.32.0"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
}
|
|
69
|
+
}
|