eslint-config-terrax 0.3.1-next.ff87203 → 0.3.2
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 +45 -25
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Terrax ESLint Config
|
|
4
4
|
|
|
5
|
-
[](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md)
|
|
6
|
+
[](https://www.npmjs.com/package/eslint-config-terrax)
|
|
7
|
+
[](https://www.npmjs.com/package/eslint-config-terrax)
|
|
7
8
|
|
|
8
9
|
</div>
|
|
9
10
|
|
|
@@ -11,41 +12,60 @@ _This config was inspired by [eslint-config-neon](https://github.com/iCrawl/esli
|
|
|
11
12
|
|
|
12
13
|
## Installation
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
```sh
|
|
16
|
+
# NPM
|
|
17
|
+
npm install -D eslint eslint-config-terrax
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
# Yarn
|
|
20
|
+
yarn add -D eslint eslint-config-terrax
|
|
21
|
+
|
|
22
|
+
# PNPM
|
|
23
|
+
pnpm add -D eslint eslint-config-terrax
|
|
20
24
|
```
|
|
21
25
|
|
|
22
|
-
##
|
|
26
|
+
## Configurations
|
|
27
|
+
|
|
28
|
+
Package includes the following configurations:
|
|
29
|
+
|
|
30
|
+
| Configuration | Description |
|
|
31
|
+
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
32
|
+
| [`eslint-config-terrax/common`](./src/common.ts) | The terrax code style guide. |
|
|
33
|
+
| [`eslint-config-terrax/browser`](./src/browser.ts) | For usage with DOM and other browser APIs. |
|
|
34
|
+
| [`eslint-config-terrax/edge`](./src/edge.ts) | For usage with an edge runtime [Vercel](https://vercel.com/blog/introducing-the-edge-runtime), [Cloudflare Workers](https://workers.cloudflare.com/), or others. |
|
|
35
|
+
| [`eslint-config-terrax/jsx`](./src/jsx.ts) | For usage with [JSX](https://reactjs.org/docs/introducing-jsx.html) (with or without [React](https://reactjs.org/)). |
|
|
36
|
+
| [`eslint-config-terrax/jsx-a11y`](./src/jsx-a11y.ts) | For usage with [JSX](https://facebook.github.io/react/) (with or without [React](https://reactjs.org/)) and want to include [accessibility checks](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y). |
|
|
37
|
+
| [`eslint-config-terrax/next`](./src/next.ts) | For usage with [Next.js](https://nextjs.org/). |
|
|
38
|
+
| [`eslint-config-terrax/node`](./src/node.ts) | For usage with Node.js. |
|
|
39
|
+
| [`eslint-config-terrax/react`](./src/react.ts) | For usage with [React](https://reactjs.org/). |
|
|
40
|
+
| [`eslint-config-terrax/typescript`](./src/typescript.ts) | For usage with [TypeScript](http://typescriptlang.org/). |
|
|
41
|
+
|
|
42
|
+
## Notes
|
|
23
43
|
|
|
24
|
-
|
|
44
|
+
### Flat Config only
|
|
25
45
|
|
|
26
|
-
|
|
27
|
-
- [`eslint-config-terrax/browser`](./src/browser.ts) – for usage with DOM and other browser APIs.
|
|
28
|
-
- [`eslint-config-terrax/edge`](./src/edge.ts) – for usage with an edge runtime [Vercel](https://vercel.com/blog/introducing-the-edge-runtime), [Cloudflare Workers](https://workers.cloudflare.com/), or others.
|
|
29
|
-
- [`eslint-config-terrax/jsx`](./src/jsx.ts) – for usage with [JSX](https://reactjs.org/docs/introducing-jsx.html) (with or without [React](https://reactjs.org/)).
|
|
30
|
-
- [`eslint-config-terrax/jsx-a11y`](./src/jsx-a11y.ts) – for usage with [JSX](https://facebook.github.io/react/) (with or without [React](https://reactjs.org/)) and want to include [accessibility checks](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y).
|
|
31
|
-
- [`eslint-config-terrax/next`](./src/next.ts) – for usage with [Next.js](https://nextjs.org/).
|
|
32
|
-
- [`eslint-config-terrax/node`](./src/node.ts) – for usage with Node.js.
|
|
33
|
-
- [`eslint-config-terrax/react`](./src/react.ts) – for usage with [React](https://reactjs.org/).
|
|
34
|
-
- [`eslint-config-terrax/typescript`](./src/typescript.ts) – for usage with [TypeScript](http://typescriptlang.org/).
|
|
46
|
+
It is important to note that this package only exports [ESLint Flat Config][]! This means that you _have_ to use at least ESLint 9 and `eslint.config.js`, `eslint.config.mjs`, or `eslint.config.cjs` to use this package. See the ESLint documentation on flat config for more information.
|
|
35
47
|
|
|
36
|
-
###
|
|
48
|
+
### Importing
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
There are two ways to import the configs:
|
|
39
51
|
|
|
40
|
-
|
|
52
|
+
```ts
|
|
53
|
+
import common from 'eslint-config-terrax/common';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
or
|
|
41
57
|
|
|
42
|
-
|
|
58
|
+
```ts
|
|
59
|
+
import { common } from 'eslint-config-terrax';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Merging Configs
|
|
43
63
|
|
|
44
64
|
In the examples below you will see `lodash.merge` being used. This is of vital importance as objects often have to be deeply merged when using ESLint Flat Config. If you don't merge the objects, you will overwrite the previous object with the new one, and your config will be invalid.
|
|
45
65
|
|
|
46
|
-
|
|
66
|
+
## Usage
|
|
47
67
|
|
|
48
|
-
|
|
68
|
+
### NodeJS
|
|
49
69
|
|
|
50
70
|
```js
|
|
51
71
|
import { common, node, typescript } from 'eslint-config-terrax';
|
|
@@ -70,7 +90,7 @@ const config = [
|
|
|
70
90
|
export default config;
|
|
71
91
|
```
|
|
72
92
|
|
|
73
|
-
|
|
93
|
+
### NextJS
|
|
74
94
|
|
|
75
95
|
```js
|
|
76
96
|
import { browser, common, edge, next, node, react, typescript } from 'eslint-config-terrax';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-terrax",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "The ESLint shareable config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/common.cjs",
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
"url": "https://github.com/rygent/eslint-config-terrax/issues"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
|
-
"@eslint/compat": "^1.2.
|
|
129
|
-
"@eslint/js": "^9.
|
|
128
|
+
"@eslint/compat": "^1.2.3",
|
|
129
|
+
"@eslint/js": "^9.15.0",
|
|
130
130
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
131
131
|
"@stylistic/eslint-plugin": "^2.10.1",
|
|
132
132
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
@@ -135,14 +135,14 @@
|
|
|
135
135
|
"eslint-plugin-react": "^7.37.2",
|
|
136
136
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
137
137
|
"globals": "^15.12.0",
|
|
138
|
-
"typescript-eslint": "^8.
|
|
138
|
+
"typescript-eslint": "^8.15.0"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@favware/cliff-jumper": "^5.0.0",
|
|
142
142
|
"@sapphire/node-utilities": "^1.0.2",
|
|
143
143
|
"@types/node": "^22.9.0",
|
|
144
144
|
"esbuild-plugin-file-path-extensions": "^2.1.3",
|
|
145
|
-
"eslint": "^9.
|
|
145
|
+
"eslint": "^9.15.0",
|
|
146
146
|
"eslint-config-prettier": "^9.1.0",
|
|
147
147
|
"eslint-plugin-prettier": "^5.2.1",
|
|
148
148
|
"prettier": "^3.3.3",
|