@haltcase/style 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/LICENSE.md +382 -0
- package/eslint/_base.js +52 -0
- package/eslint/browser.js +8 -0
- package/eslint/cjs.js +21 -0
- package/eslint/constants.js +13 -0
- package/eslint/jest.js +28 -0
- package/eslint/next.js +27 -0
- package/eslint/node.js +8 -0
- package/eslint/playwright-test.js +8 -0
- package/eslint/react.js +18 -0
- package/eslint/rules/best-practice.js +239 -0
- package/eslint/rules/es2015.js +71 -0
- package/eslint/rules/import.js +85 -0
- package/eslint/rules/jest.js +28 -0
- package/eslint/rules/jsx-a11y.js +20 -0
- package/eslint/rules/playwright-test.js +28 -0
- package/eslint/rules/possible-errors.js +47 -0
- package/eslint/rules/react.js +117 -0
- package/eslint/rules/simple-import-sort.js +23 -0
- package/eslint/rules/stylistic.js +86 -0
- package/eslint/rules/tsdoc.js +17 -0
- package/eslint/rules/typescript/extension.js +45 -0
- package/eslint/rules/typescript/import.js +22 -0
- package/eslint/rules/typescript/index.js +89 -0
- package/eslint/rules/typescript/strict.js +18 -0
- package/eslint/rules/unicorn.js +677 -0
- package/eslint/rules/variables.js +36 -0
- package/eslint/typescript.js +26 -0
- package/eslint/utils/require-package.js +44 -0
- package/package.json +100 -0
- package/prettier/index.js +21 -0
- package/readme.md +228 -0
- package/typescript/tsconfig.base.json +13 -0
- package/typescript/tsconfig.bundler.json +13 -0
- package/typescript/tsconfig.next.json +26 -0
- package/typescript/tsconfig.node.json +4 -0
- package/typescript/tsconfig.node18.json +13 -0
- package/typescript/tsconfig.node20.json +13 -0
- package/typescript/tsconfig.web.json +8 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
levels: { warn, error }
|
|
5
|
+
} = require("../constants");
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
rules: {
|
|
9
|
+
/**
|
|
10
|
+
* Disallow labels that share a name with a variable.
|
|
11
|
+
*
|
|
12
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-label-var
|
|
13
|
+
*/
|
|
14
|
+
"no-label-var": error,
|
|
15
|
+
/**
|
|
16
|
+
* Disallow initializing variables to `undefined`.
|
|
17
|
+
*
|
|
18
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-undef-init
|
|
19
|
+
*/
|
|
20
|
+
"no-undef-init": warn,
|
|
21
|
+
/**
|
|
22
|
+
* Disallow unused variables.
|
|
23
|
+
*
|
|
24
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-unused-vars
|
|
25
|
+
*/ "no-unused-vars": [
|
|
26
|
+
error,
|
|
27
|
+
{
|
|
28
|
+
args: "after-used",
|
|
29
|
+
argsIgnorePattern: "^_",
|
|
30
|
+
ignoreRestSiblings: true,
|
|
31
|
+
vars: "all",
|
|
32
|
+
varsIgnorePattern: "^_"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { typescriptFiles } = require("./constants");
|
|
4
|
+
const checkForPackage = require("./utils/require-package");
|
|
5
|
+
|
|
6
|
+
checkForPackage("typescript", "typescript");
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
overrides: [
|
|
10
|
+
{
|
|
11
|
+
files: typescriptFiles,
|
|
12
|
+
extends: [
|
|
13
|
+
"plugin:@typescript-eslint/recommended",
|
|
14
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
15
|
+
"plugin:@typescript-eslint/strict",
|
|
16
|
+
"plugin:import/typescript",
|
|
17
|
+
"prettier",
|
|
18
|
+
require.resolve("./rules/typescript"),
|
|
19
|
+
require.resolve("./rules/typescript/extension"),
|
|
20
|
+
require.resolve("./rules/typescript/import"),
|
|
21
|
+
require.resolve("./rules/typescript/strict"),
|
|
22
|
+
require.resolve("./rules/tsdoc")
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const packageJson = require("../../package.json");
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @returns {string} The name of the package manager.
|
|
8
|
+
*/
|
|
9
|
+
const readPackageManager = () => {
|
|
10
|
+
const match = process.env.npm_config_user_agent?.match(/^(?<pm>\w+)\//);
|
|
11
|
+
return match?.groups ? match.groups?.pm : "npm";
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} configName
|
|
16
|
+
* @param {string} packageName
|
|
17
|
+
*/
|
|
18
|
+
module.exports = (configName, packageName) => {
|
|
19
|
+
try {
|
|
20
|
+
require.resolve(packageName);
|
|
21
|
+
} catch {
|
|
22
|
+
const packageManager = readPackageManager();
|
|
23
|
+
const command =
|
|
24
|
+
packageManager === "yarn" || packageManager === "pnpm"
|
|
25
|
+
? "add"
|
|
26
|
+
: "install";
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
29
|
+
const dev = packageManager === "yarn" ? "--dev" : "--save-dev";
|
|
30
|
+
|
|
31
|
+
/* eslint-disable no-console */
|
|
32
|
+
console.error(
|
|
33
|
+
`The \`${configName}\` config requires an optional peer dependency, which has not been installed.`
|
|
34
|
+
);
|
|
35
|
+
console.error();
|
|
36
|
+
console.error("To install it, run:");
|
|
37
|
+
console.error(
|
|
38
|
+
`- ${packageManager} ${command} ${dev} ${packageName}@${packageJson.peerDependencies[packageName]}`
|
|
39
|
+
);
|
|
40
|
+
/* eslint-enable no-console */
|
|
41
|
+
|
|
42
|
+
throw new Error(`Missing dependency encountered: ${packageName}`);
|
|
43
|
+
}
|
|
44
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@haltcase/style",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "haltcase's web ecosystem style guide & configurations",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"eslint",
|
|
7
|
+
"prettier",
|
|
8
|
+
"typescript",
|
|
9
|
+
"style",
|
|
10
|
+
"eslint-config"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/haltcase/style#readme",
|
|
13
|
+
"bugs": "https://github.com/haltcase/style/issues",
|
|
14
|
+
"repository": "https://github.com/haltcase/style.git",
|
|
15
|
+
"license": "MPL-2.0",
|
|
16
|
+
"author": "Bo Lingen <bo@lingen.life> (https://bolingen.me)",
|
|
17
|
+
"exports": {
|
|
18
|
+
"typescript/base": "./typescript/tsconfig.base.json",
|
|
19
|
+
"typescript/bundler": "./typescript/tsconfig.bundler.json",
|
|
20
|
+
"typescript/next": "./typescript/tsconfig.next.json",
|
|
21
|
+
"typescript/node": "./typescript/tsconfig.node.json",
|
|
22
|
+
"typescript/node18": "./typescript/tsconfig.node18.json",
|
|
23
|
+
"typescript/node20": "./typescript/tsconfig.node20.json",
|
|
24
|
+
"typescript/web": "./typescript/tsconfig.web.json"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"eslint",
|
|
28
|
+
"prettier",
|
|
29
|
+
"typescript"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"eslint-check": "eslint --max-warnings=0 .",
|
|
33
|
+
"format": "eslint --fix . && prettier --write .",
|
|
34
|
+
"prepare": "husky install",
|
|
35
|
+
"prettier-check": "prettier --check .",
|
|
36
|
+
"semantic-release": "semantic-release",
|
|
37
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
38
|
+
},
|
|
39
|
+
"prettier": "./prettier",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@babel/core": "^7.22.1",
|
|
42
|
+
"@babel/eslint-parser": "^7.21.8",
|
|
43
|
+
"@rushstack/eslint-patch": "^1.3.0",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
|
45
|
+
"@typescript-eslint/parser": "^5.59.9",
|
|
46
|
+
"eslint-config-prettier": "^8.8.0",
|
|
47
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
48
|
+
"eslint-import-resolver-typescript": "^3.5.5",
|
|
49
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
50
|
+
"eslint-plugin-import": "^2.27.5",
|
|
51
|
+
"eslint-plugin-jest": "^27.2.1",
|
|
52
|
+
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
53
|
+
"eslint-plugin-playwright": "^0.12.0",
|
|
54
|
+
"eslint-plugin-react": "^7.32.2",
|
|
55
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
56
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
57
|
+
"eslint-plugin-testing-library": "^5.11.0",
|
|
58
|
+
"eslint-plugin-tsdoc": "^0.2.17",
|
|
59
|
+
"eslint-plugin-unicorn": "^47.0.0",
|
|
60
|
+
"prettier-plugin-packagejson": "^2.4.3"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@commitlint/cli": "^17.6.5",
|
|
64
|
+
"@commitlint/config-conventional": "^17.6.5",
|
|
65
|
+
"@semantic-release/git": "^10.0.1",
|
|
66
|
+
"eslint": "^8.42.0",
|
|
67
|
+
"husky": "^8.0.3",
|
|
68
|
+
"prettier": "^2.8.8",
|
|
69
|
+
"pretty-quick": "^3.1.3",
|
|
70
|
+
"semantic-release": "^19.0.5",
|
|
71
|
+
"typescript": "^5.1.3"
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"@next/eslint-plugin-next": "^13.4.4",
|
|
75
|
+
"eslint": "^8.42.0",
|
|
76
|
+
"prettier": "^2.8.8",
|
|
77
|
+
"typescript": "^5.1.3"
|
|
78
|
+
},
|
|
79
|
+
"peerDependenciesMeta": {
|
|
80
|
+
"@next/eslint-plugin-next": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"eslint": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"prettier": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
89
|
+
"typescript": {
|
|
90
|
+
"optional": true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"packageManager": "pnpm@8.6.1",
|
|
94
|
+
"engines": {
|
|
95
|
+
"node": "20"
|
|
96
|
+
},
|
|
97
|
+
"publishConfig": {
|
|
98
|
+
"access": "public"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Some of Prettier's defaults can be overridden by an EditorConfig file. We
|
|
5
|
+
* define those here to ensure that doesn't happen.
|
|
6
|
+
*
|
|
7
|
+
* See: https://github.com/prettier/prettier/blob/main/docs/configuration.md#editorconfig
|
|
8
|
+
*/
|
|
9
|
+
const overridableDefaults = {
|
|
10
|
+
endOfLine: "lf",
|
|
11
|
+
printWidth: 80,
|
|
12
|
+
tabWidth: 2,
|
|
13
|
+
useTabs: true
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
module.exports = {
|
|
17
|
+
...overridableDefaults,
|
|
18
|
+
singleQuote: false,
|
|
19
|
+
trailingComma: "none",
|
|
20
|
+
plugins: ["prettier-plugin-packagejson"]
|
|
21
|
+
};
|
package/readme.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# `@haltcase/style` · [](https://www.npmjs.com/package/@haltcase/style) [](https://www.npmjs.com/package/@haltcase/style) [](https://github.com/haltcase/style/actions)
|
|
2
|
+
|
|
3
|
+
> Style guide and configurations for tools in the web ecosystem.
|
|
4
|
+
|
|
5
|
+
- [Prettier](#prettier)
|
|
6
|
+
- [ESLint](#eslint)
|
|
7
|
+
- [TypeScript](#typescript)
|
|
8
|
+
|
|
9
|
+
> This package originated from [Vercel's style guide](https://github.com/vercel/style-guide).
|
|
10
|
+
|
|
11
|
+
## installation
|
|
12
|
+
|
|
13
|
+
Install `@haltcase/style` with your preferred package manager:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
# npm
|
|
17
|
+
npm i --save-dev @haltcase/style
|
|
18
|
+
|
|
19
|
+
# pnpm
|
|
20
|
+
pnpm i --save-dev @haltcase/style
|
|
21
|
+
|
|
22
|
+
# yarn
|
|
23
|
+
yarn add --dev @haltcase/style
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> Some ESLint scenarios require additional peer dependencies.
|
|
27
|
+
> See the [ESLint](#eslint) section.
|
|
28
|
+
|
|
29
|
+
## usage
|
|
30
|
+
|
|
31
|
+
### Prettier
|
|
32
|
+
|
|
33
|
+
> **Note**
|
|
34
|
+
> Prettier is a peer dependency you'll need to install
|
|
35
|
+
> at the root of your project.
|
|
36
|
+
>
|
|
37
|
+
> See: https://prettier.io/docs/en/install.html
|
|
38
|
+
|
|
39
|
+
Add the following in `package.json`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"prettier": "@haltcase/style/prettier"
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### ESLint
|
|
48
|
+
|
|
49
|
+
> **Note**
|
|
50
|
+
> ESLint is a peer dependency you'll need to install
|
|
51
|
+
> at the root of your project.
|
|
52
|
+
>
|
|
53
|
+
> See: https://eslint.org/docs/user-guide/getting-started#installation-and-usage
|
|
54
|
+
|
|
55
|
+
Several ESLint configs are available which can be combined.
|
|
56
|
+
|
|
57
|
+
Start with at least one of these base configs, which should always be first in `extends`:
|
|
58
|
+
|
|
59
|
+
- `@haltcase/style/eslint/browser`
|
|
60
|
+
- `@haltcase/style/eslint/node`
|
|
61
|
+
|
|
62
|
+
> **Note**
|
|
63
|
+
> You can scope configs so they only target specific files.
|
|
64
|
+
>
|
|
65
|
+
> See: [Scoped configuration with `overrides`](#scoped-configuration-with-overrides).
|
|
66
|
+
|
|
67
|
+
The following additional configs are available:
|
|
68
|
+
|
|
69
|
+
- `@haltcase/style/eslint/jest`
|
|
70
|
+
- `@haltcase/style/eslint/next` (requires `@next/eslint-plugin-next` to be installed at the same version as `next`)
|
|
71
|
+
- `@haltcase/style/eslint/playwright-test`
|
|
72
|
+
- `@haltcase/style/eslint/react`
|
|
73
|
+
- `@haltcase/style/eslint/typescript` (requires `typescript` to be installed and [additional configuration](#configuring-eslint-for-typescript))
|
|
74
|
+
|
|
75
|
+
Be sure to use `require.resolve` to reference these configs — ESLint requires absolute paths ([eslint/eslint#9188](https://github.com/eslint/eslint/issues/9188)).
|
|
76
|
+
|
|
77
|
+
For example, to use the shared ESLint config(s) in a Next.js project, set the
|
|
78
|
+
following in `.eslintrc.js`.
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
module.exports = {
|
|
82
|
+
extends: [
|
|
83
|
+
require.resolve("@haltcase/style/eslint/browser"),
|
|
84
|
+
require.resolve("@haltcase/style/eslint/react"),
|
|
85
|
+
require.resolve("@haltcase/style/eslint/next")
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Configuring ESLint for TypeScript
|
|
91
|
+
|
|
92
|
+
Some of the rules enabled in the TypeScript config require additional type
|
|
93
|
+
information, you'll need to provide the path to your `tsconfig.json`.
|
|
94
|
+
|
|
95
|
+
For more information, see: https://typescript-eslint.io/docs/linting/type-linting
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
const { resolve } = require("path");
|
|
99
|
+
|
|
100
|
+
const project = resolve(__dirname, "tsconfig.json");
|
|
101
|
+
|
|
102
|
+
module.exports = {
|
|
103
|
+
root: true,
|
|
104
|
+
extends: [
|
|
105
|
+
require.resolve("@haltcase/style/eslint/node"),
|
|
106
|
+
require.resolve("@haltcase/style/eslint/typescript")
|
|
107
|
+
],
|
|
108
|
+
parserOptions: {
|
|
109
|
+
project
|
|
110
|
+
},
|
|
111
|
+
settings: {
|
|
112
|
+
"import/resolver": {
|
|
113
|
+
typescript: {
|
|
114
|
+
project
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Configuring custom components for `jsx-a11y`
|
|
122
|
+
|
|
123
|
+
It's common practice for React apps to have shared components like `Button`
|
|
124
|
+
that wrap native elements. You can pass this information along to `jsx-a11y`
|
|
125
|
+
via the `components` setting.
|
|
126
|
+
|
|
127
|
+
The below list is not exhaustive.
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
module.exports = {
|
|
131
|
+
root: true,
|
|
132
|
+
extends: [require.resolve("@haltcase/style/eslint/react")],
|
|
133
|
+
settings: {
|
|
134
|
+
"jsx-a11y": {
|
|
135
|
+
components: {
|
|
136
|
+
Article: "article",
|
|
137
|
+
Button: "button",
|
|
138
|
+
Image: "img",
|
|
139
|
+
Input: "input",
|
|
140
|
+
Link: "a",
|
|
141
|
+
Video: "video"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### Scoped configuration with `overrides`
|
|
149
|
+
|
|
150
|
+
ESLint configs can be scoped to include/exclude specific paths. This ensures
|
|
151
|
+
that rules don't "leak" into places where those rules don't apply.
|
|
152
|
+
|
|
153
|
+
In this example, Jest rules are only being applied to files matching Jest's
|
|
154
|
+
default test match pattern.
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
module.exports = {
|
|
158
|
+
extends: [require.resolve("@haltcase/style/eslint/node")],
|
|
159
|
+
overrides: [
|
|
160
|
+
{
|
|
161
|
+
files: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
|
|
162
|
+
extends: [require.resolve("@haltcase/style/eslint/jest")]
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
};
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
##### A note on file extensions
|
|
169
|
+
|
|
170
|
+
By default, all TypeScript rules are scoped to files ending with `.ts` and
|
|
171
|
+
`.tsx`.
|
|
172
|
+
|
|
173
|
+
However, when using overrides, file extensions must be included or ESLint will
|
|
174
|
+
only include `.js` files.
|
|
175
|
+
|
|
176
|
+
```js
|
|
177
|
+
module.exports = {
|
|
178
|
+
overrides: [
|
|
179
|
+
{
|
|
180
|
+
files: ["directory/**/*.[jt]s?(x)"],
|
|
181
|
+
rules: {
|
|
182
|
+
"my-rule": "off"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
};
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### TypeScript
|
|
190
|
+
|
|
191
|
+
Several Typescript configs are available to cover various scenarios:
|
|
192
|
+
|
|
193
|
+
| Name | Description |
|
|
194
|
+
| ------------------------------------ | ---------------------------------------------------------------------------------------------------- |
|
|
195
|
+
| `@haltcase/style/typescript/base` | Baseline config, intended to be extended from. |
|
|
196
|
+
| `@haltcase/style/typescript/bundler` | For use in bundled projects, most commonly [Vite](https://vitejs.dev/) + [React](https://react.dev). |
|
|
197
|
+
| `@haltcase/style/typescript/next` | For use in [Next.js](https://nextjs.org/) projects. |
|
|
198
|
+
| `@haltcase/style/typescript/node` | Default Node config, currently targeting Node 20. |
|
|
199
|
+
| `@haltcase/style/typescript/node18` | For projects targeting Node 18. |
|
|
200
|
+
| `@haltcase/style/typescript/node20` | For projects targeting Node 20. |
|
|
201
|
+
| `@haltcase/style/typescript/web` | For use in web projects. |
|
|
202
|
+
|
|
203
|
+
Typically, you'll only need to extend from one of these:
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"extends": "@haltcase/style/typescript/next"
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
You could also combine them with an `extends` array in [Typescript 5+](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-rc/#supporting-multiple-configuration-files-in-extends):
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"extends": [
|
|
216
|
+
"@haltcase/style/typescript/node",
|
|
217
|
+
"@haltcase/style/typescript/web"
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
> **Note**
|
|
223
|
+
> Run `tsc --showConfig` to see the result of the combined configs.
|
|
224
|
+
|
|
225
|
+
## contributing
|
|
226
|
+
|
|
227
|
+
Please read our [contributing](https://github.com/haltcase/style/blob/main/CONTRIBUTING.md)
|
|
228
|
+
guide before creating a pull request.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"esModuleInterop": true,
|
|
5
|
+
"forceConsistentCasingInFileNames": true,
|
|
6
|
+
"incremental": true,
|
|
7
|
+
"isolatedModules": true,
|
|
8
|
+
"noFallthroughCasesInSwitch": true,
|
|
9
|
+
"noUncheckedIndexedAccess": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"strict": true
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./tsconfig.base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"target": "ES2015"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"forceConsistentCasingInFileNames": true,
|
|
7
|
+
"incremental": true,
|
|
8
|
+
"isolatedModules": true,
|
|
9
|
+
"jsx": "preserve",
|
|
10
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
11
|
+
"module": "ESNext",
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"strict": true,
|
|
17
|
+
"target": "ES5",
|
|
18
|
+
"plugins": [
|
|
19
|
+
{
|
|
20
|
+
"name": "next"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
25
|
+
"exclude": ["node_modules"]
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./tsconfig.base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"lib": ["ES2023"],
|
|
7
|
+
"module": "Node16",
|
|
8
|
+
"moduleResolution": "nodenext",
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"target": "ES2022"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./tsconfig.base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"lib": ["ES2023"],
|
|
7
|
+
"module": "Node16",
|
|
8
|
+
"moduleResolution": "nodenext",
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"target": "ES2023"
|
|
12
|
+
}
|
|
13
|
+
}
|