@useinsider/eslint-config 1.0.1-beta.4 → 1.0.1-beta.5
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 +69 -0
- package/package.json +1 -1
- package/src/node.cjs +3 -0
- package/src/typescript-dom.cjs +45 -0
- package/src/typescript.cjs +2 -6
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# ESLint Config
|
|
2
|
+
|
|
3
|
+
Welcome to Insider's shared ESLint configuration! This project offers a set of
|
|
4
|
+
ESLint rules tailored for both EcmaScript/JavaScript and TypeScript. It is
|
|
5
|
+
designed to help you seamlessly integrate Insider's coding style into your
|
|
6
|
+
development workflow.
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
- [ESLint Config](#eslint-config)
|
|
10
|
+
- [Table of Contents](#table-of-contents)
|
|
11
|
+
- [Getting Started](#getting-started)
|
|
12
|
+
- [Installation](#installation)
|
|
13
|
+
- [Available Configurations](#available-configurations)
|
|
14
|
+
- [Upcoming Configurations](#upcoming-configurations)
|
|
15
|
+
- [Contributing](#contributing)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Getting Started
|
|
19
|
+
|
|
20
|
+
To ensure consistency and prevent version conflicts, we recommend adding this
|
|
21
|
+
library as a development dependency with a fixed version. This can be achieved
|
|
22
|
+
using the `-D` and `-E` flags in your package manager commands.
|
|
23
|
+
|
|
24
|
+
### Installation
|
|
25
|
+
|
|
26
|
+
1. **Install as a Development Dependency:**
|
|
27
|
+
- For npm users:
|
|
28
|
+
```bash
|
|
29
|
+
npm install -D -E @useinsider/eslint-config
|
|
30
|
+
```
|
|
31
|
+
- For pnpm users:
|
|
32
|
+
```bash
|
|
33
|
+
pnpm add -D -E @useinsider/eslint-config
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
2. **Extend the Configuration:**
|
|
37
|
+
Add the following to your `.eslintrc` file to extend the configuration:
|
|
38
|
+
```json5
|
|
39
|
+
{
|
|
40
|
+
"extends": ["@useinsider/eslint-config/dom"],
|
|
41
|
+
// Add the rest of your configuration here
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Available Configurations
|
|
46
|
+
|
|
47
|
+
We provide a variety of configurations to suit different environments and
|
|
48
|
+
frameworks. Here's a list of available configurations:
|
|
49
|
+
|
|
50
|
+
| Environment | Browser | Node |
|
|
51
|
+
| :---------------- | :--------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| **EcmaScript/JS** | [`@useinsider/eslint-config/dom`](./src/dom.cjs) | [`@useinsider/eslint-config`](./src/node.cjs)<br>[`@useinsider/eslint-config/node`](./src/node.cjs) |
|
|
53
|
+
| **TypeScript** | [`@useinsider/eslint-config/typescript-dom`](./src/typescript-dom.cjs) | [`@useinsider/eslint-config/typescript`](./src/typescript.cjs) |
|
|
54
|
+
| **Vue 3** | [`@useinsider/eslint-config/vue3`](./src/vue3.cjs) | - |
|
|
55
|
+
|
|
56
|
+
### Upcoming Configurations
|
|
57
|
+
|
|
58
|
+
Not available yet!
|
|
59
|
+
|
|
60
|
+
| Environment | Browser | Node |
|
|
61
|
+
| :---------------- | :------------------------------------------------------------- | :----------------------------------------------------- |
|
|
62
|
+
| **Legacy ES5 💀** | [`@useinsider/eslint-config/legacy-dom`](./src/legacy-dom.cjs) | [`@useinsider/eslint-config/legacy`](./src/legacy.cjs) |
|
|
63
|
+
| **Vue 2** | [`@useinsider/eslint-config/vue2`](./src/vue2.cjs) | - |
|
|
64
|
+
|
|
65
|
+
## Contributing
|
|
66
|
+
|
|
67
|
+
Your contributions are welcome!
|
|
68
|
+
Please consult the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines on how
|
|
69
|
+
to contribute to this project.
|
package/package.json
CHANGED
package/src/node.cjs
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: [
|
|
4
|
+
require.resolve('./base.cjs'),
|
|
5
|
+
'airbnb-base',
|
|
6
|
+
'airbnb-typescript/base',
|
|
7
|
+
'plugin:@cspell/recommended',
|
|
8
|
+
'plugin:jsdoc/recommended',
|
|
9
|
+
'plugin:jsdoc/recommended-typescript-error',
|
|
10
|
+
'plugin:@typescript-eslint/recommended',
|
|
11
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
12
|
+
require.resolve('./rules/agnostic.cjs'),
|
|
13
|
+
require.resolve('./rules/stylistic.cjs'),
|
|
14
|
+
require.resolve('./rules/jsdoc.cjs'),
|
|
15
|
+
require.resolve('./rules/typescript.cjs'),
|
|
16
|
+
],
|
|
17
|
+
plugins: ['@typescript-eslint'],
|
|
18
|
+
env: {
|
|
19
|
+
browser: true,
|
|
20
|
+
es2021: true,
|
|
21
|
+
},
|
|
22
|
+
parser: '@typescript-eslint/parser',
|
|
23
|
+
parserOptions: {
|
|
24
|
+
ecmaVersion: 'latest',
|
|
25
|
+
sourceType: 'module',
|
|
26
|
+
ecmaFeatures: {
|
|
27
|
+
jsx: true,
|
|
28
|
+
},
|
|
29
|
+
extraFileExtensions: ['.vue', 'gs'],
|
|
30
|
+
},
|
|
31
|
+
rules: {
|
|
32
|
+
'jsdoc/require-param': 'off',
|
|
33
|
+
'jsdoc/require-jsdoc': 'off',
|
|
34
|
+
'jsdoc/require-returns': 'off',
|
|
35
|
+
},
|
|
36
|
+
settings: {
|
|
37
|
+
jsdoc: {
|
|
38
|
+
mode: 'typescript',
|
|
39
|
+
tagNamePreference: {
|
|
40
|
+
callback: 'watch',
|
|
41
|
+
desc: 'use',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
package/src/typescript.cjs
CHANGED
|
@@ -3,8 +3,8 @@ module.exports = {
|
|
|
3
3
|
extends: [
|
|
4
4
|
require.resolve('./base.cjs'),
|
|
5
5
|
'airbnb-typescript/base',
|
|
6
|
-
'plugin:jsdoc/recommended',
|
|
7
6
|
'plugin:@cspell/recommended',
|
|
7
|
+
'plugin:jsdoc/recommended',
|
|
8
8
|
'plugin:jsdoc/recommended-typescript-error',
|
|
9
9
|
'plugin:@typescript-eslint/recommended',
|
|
10
10
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
@@ -15,17 +15,13 @@ module.exports = {
|
|
|
15
15
|
],
|
|
16
16
|
plugins: ['@typescript-eslint'],
|
|
17
17
|
env: {
|
|
18
|
-
|
|
18
|
+
node: true,
|
|
19
19
|
es2021: true,
|
|
20
20
|
},
|
|
21
21
|
parser: '@typescript-eslint/parser',
|
|
22
22
|
parserOptions: {
|
|
23
23
|
ecmaVersion: 'latest',
|
|
24
24
|
sourceType: 'module',
|
|
25
|
-
ecmaFeatures: {
|
|
26
|
-
jsx: true,
|
|
27
|
-
},
|
|
28
|
-
extraFileExtensions: ['.vue', 'gs'],
|
|
29
25
|
},
|
|
30
26
|
rules: {
|
|
31
27
|
'jsdoc/require-param': 'off',
|