@aditosoftware/eslint-config-adito-platform 1.0.6
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/.github/CODEOWNERS +2 -0
- package/.github/pull_request_template.md +10 -0
- package/.github/workflows/nodejs.yml +25 -0
- package/.github/workflows/npm-publish.yml +32 -0
- package/CHANGELOG.md +72 -0
- package/README.md +26 -0
- package/index.mjs +150 -0
- package/package.json +21 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
# Please check before merging
|
|
3
|
+
|
|
4
|
+
- [ ] Is the content of the `README.md` file still up-to-date?
|
|
5
|
+
- [ ] Have you added an entry to the `CHANGELOG.md`?
|
|
6
|
+
- [ ] Is the pull request title written in the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format?
|
|
7
|
+
|
|
8
|
+
# Description
|
|
9
|
+
|
|
10
|
+
Please describe your pull request.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Build Project
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
node-version: [18.x, 20.x, 22.x]
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- name: Set up Node.js
|
|
15
|
+
uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: ${{ matrix.node-version }}
|
|
18
|
+
- name: Check Node.js version
|
|
19
|
+
run: node -v
|
|
20
|
+
|
|
21
|
+
- name: Check npm versions
|
|
22
|
+
run: npm -v
|
|
23
|
+
|
|
24
|
+
- name: Run clean install
|
|
25
|
+
run: npm ci
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: 20
|
|
18
|
+
- run: npm ci
|
|
19
|
+
|
|
20
|
+
publish-npm:
|
|
21
|
+
needs: build
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: 20
|
|
28
|
+
registry-url: https://registry.npmjs.org/
|
|
29
|
+
- run: npm ci
|
|
30
|
+
- run: npm publish --access public
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## 1.0.6
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Upgraded dependencies:
|
|
14
|
+
- @typescript-eslint/eslint-plugin to 8.5.0
|
|
15
|
+
- @typescript-eslint/parser to 8.5.0
|
|
16
|
+
- @stylistic/eslint-plugin to 2.8.0
|
|
17
|
+
|
|
18
|
+
## 1.0.5
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Upgraded dependencies:
|
|
23
|
+
- @typescript-eslint/eslint-plugin to 8.4.0
|
|
24
|
+
- @typescript-eslint/parser to 8.4.0
|
|
25
|
+
- @stylistic/eslint-plugin to 2.7.2
|
|
26
|
+
- eslint-plugin-jsdoc to 50.2.2
|
|
27
|
+
|
|
28
|
+
## 1.0.4
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- Upgraded dependencies:
|
|
33
|
+
- @typescript-eslint/eslint-plugin to 8.0.0
|
|
34
|
+
- @typescript-eslint/parser to 8.0.0
|
|
35
|
+
- @stylistic/eslint-plugin to 2.6.0
|
|
36
|
+
- eslint-plugin-chai-friendly to 1.0.1
|
|
37
|
+
- eslint-plugin-jsdoc to 48.10.2
|
|
38
|
+
- eslint-plugin-tsdoc to 0.3.0
|
|
39
|
+
|
|
40
|
+
## 1.0.3
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- Reduced the level for prettier from `error` to `warn`
|
|
45
|
+
|
|
46
|
+
## 1.0.2
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
|
|
50
|
+
- Added `eslint-config-prettier` and its recommended configuration
|
|
51
|
+
- Added `eslint-plugin-chai-expect` and its recommended configuration
|
|
52
|
+
- Added `eslint-plugin-deprecation` and its recommended configuration
|
|
53
|
+
- Added `eslint-plugin-prettier` and its recommended configuration. **Note:**
|
|
54
|
+
You need to add the following to your `.prettierrc` file in order to have you eslint rule work as intended:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"endOfLine": "auto"
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 1.0.1
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
|
|
66
|
+
- Added `eslint-plugin-chai-friendly` and its recommended configuration
|
|
67
|
+
|
|
68
|
+
## 1.0.0
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
|
|
72
|
+
- Initial release
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# eslint-config-adito-platform
|
|
2
|
+
|
|
3
|
+
This is a shared eslint config for the platform teams of ADITO. It contains rules for code quality and documentation.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
1. Install via `npm install --save-dev @aditosoftware/eslint-config-adito-platform`
|
|
8
|
+
2. Create a file named `eslint.config.mjs` in your project.
|
|
9
|
+
3. Include the configuration:
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
import config from "@aditosoftware/eslint-config-adito-platform";
|
|
13
|
+
|
|
14
|
+
export default [...config];
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
In order to have the prettier rules working, you need to add the following to your `.prettierrc` file:
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"endOfLine": "auto"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Notes
|
|
25
|
+
|
|
26
|
+
The shared config was created in accordance with this documentation: https://eslint.org/docs/latest/extend/shareable-configs
|
package/index.mjs
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
2
|
+
import tsdoc from "eslint-plugin-tsdoc";
|
|
3
|
+
import globals from "globals";
|
|
4
|
+
import tsParser from "@typescript-eslint/parser";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import js from "@eslint/js";
|
|
8
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
9
|
+
import stylistic from "@stylistic/eslint-plugin";
|
|
10
|
+
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
13
|
+
const compat = new FlatCompat({
|
|
14
|
+
baseDirectory: __dirname,
|
|
15
|
+
recommendedConfig: js.configs.recommended,
|
|
16
|
+
allConfig: js.configs.all,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export default [
|
|
20
|
+
{
|
|
21
|
+
ignores: [
|
|
22
|
+
"**/out",
|
|
23
|
+
"**/dist",
|
|
24
|
+
"**/*.d.ts",
|
|
25
|
+
"**/build",
|
|
26
|
+
"**/*.js",
|
|
27
|
+
"**/*.mjs",
|
|
28
|
+
".vscode-test/**",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
...compat.extends(
|
|
32
|
+
"eslint:recommended",
|
|
33
|
+
"plugin:@typescript-eslint/recommended",
|
|
34
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
35
|
+
"plugin:jsdoc/recommended-typescript",
|
|
36
|
+
"plugin:chai-friendly/recommended",
|
|
37
|
+
"plugin:chai-expect/recommended",
|
|
38
|
+
"plugin:deprecation/recommended",
|
|
39
|
+
// prettier needs to be the last line
|
|
40
|
+
"plugin:prettier/recommended"
|
|
41
|
+
),
|
|
42
|
+
{
|
|
43
|
+
plugins: {
|
|
44
|
+
"@typescript-eslint": typescriptEslint,
|
|
45
|
+
"@stylistic": stylistic,
|
|
46
|
+
tsdoc,
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
languageOptions: {
|
|
50
|
+
globals: {
|
|
51
|
+
...globals.browser,
|
|
52
|
+
...globals.node,
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
parser: tsParser,
|
|
56
|
+
ecmaVersion: 6,
|
|
57
|
+
sourceType: "module",
|
|
58
|
+
|
|
59
|
+
parserOptions: {
|
|
60
|
+
project: true,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
settings: {
|
|
65
|
+
jsdoc: {
|
|
66
|
+
mode: "typescript",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
rules: {
|
|
71
|
+
// disable original rule in order to have chai-friendly/no-unused-expressions to check it.
|
|
72
|
+
// this will also check to normal findings found by this disabled rule
|
|
73
|
+
"@typescript-eslint/no-unused-expressions": "off",
|
|
74
|
+
|
|
75
|
+
"prettier/prettier": "warn",
|
|
76
|
+
|
|
77
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
78
|
+
|
|
79
|
+
"@typescript-eslint/explicit-function-return-type": [
|
|
80
|
+
"error",
|
|
81
|
+
{
|
|
82
|
+
allowExpressions: true,
|
|
83
|
+
allowTypedFunctionExpressions: true,
|
|
84
|
+
allowHigherOrderFunctions: true,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
|
|
88
|
+
"@typescript-eslint/naming-convention": [
|
|
89
|
+
"warn",
|
|
90
|
+
{
|
|
91
|
+
selector: "import",
|
|
92
|
+
format: ["camelCase", "PascalCase"],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
"@stylistic/semi": "warn",
|
|
96
|
+
curly: "warn",
|
|
97
|
+
eqeqeq: "warn",
|
|
98
|
+
"no-throw-literal": "warn",
|
|
99
|
+
"tsdoc/syntax": "warn",
|
|
100
|
+
|
|
101
|
+
"jsdoc/tag-lines": [
|
|
102
|
+
"warn",
|
|
103
|
+
"never",
|
|
104
|
+
{
|
|
105
|
+
startLines: 1,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
|
|
109
|
+
"jsdoc/no-blank-block-descriptions": "warn",
|
|
110
|
+
|
|
111
|
+
"jsdoc/check-tag-names": [
|
|
112
|
+
"warn",
|
|
113
|
+
{
|
|
114
|
+
definedTags: ["remarks", "typeParam"],
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
|
|
118
|
+
"jsdoc/require-param": [
|
|
119
|
+
"warn",
|
|
120
|
+
{
|
|
121
|
+
checkDestructured: false,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
|
|
125
|
+
"jsdoc/check-param-names": [
|
|
126
|
+
"warn",
|
|
127
|
+
{
|
|
128
|
+
checkDestructured: false,
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
|
|
132
|
+
"jsdoc/check-indentation": "warn",
|
|
133
|
+
"jsdoc/check-line-alignment": "warn",
|
|
134
|
+
|
|
135
|
+
"jsdoc/require-jsdoc": [
|
|
136
|
+
"warn",
|
|
137
|
+
{
|
|
138
|
+
require: {
|
|
139
|
+
FunctionDeclaration: true,
|
|
140
|
+
MethodDefinition: true,
|
|
141
|
+
ClassDeclaration: true,
|
|
142
|
+
ClassExpression: true,
|
|
143
|
+
ArrowFunctionExpression: false,
|
|
144
|
+
FunctionExpression: false,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aditosoftware/eslint-config-adito-platform",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "eslint configuration for the platform team of ADITO",
|
|
5
|
+
"main": "index.mjs",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
|
9
|
+
"@typescript-eslint/parser": "^8.5.0",
|
|
10
|
+
"@stylistic/eslint-plugin": "^2.8.0",
|
|
11
|
+
"eslint": "^8.57.0",
|
|
12
|
+
"eslint-config-prettier": "^9.1.0",
|
|
13
|
+
"eslint-plugin-chai-expect": "^3.1.0",
|
|
14
|
+
"eslint-plugin-chai-friendly": "^1.0.1",
|
|
15
|
+
"eslint-plugin-deprecation": "^3.0.0",
|
|
16
|
+
"eslint-plugin-jsdoc": "^50.2.2",
|
|
17
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
18
|
+
"eslint-plugin-tsdoc": "^0.3.0",
|
|
19
|
+
"prettier": "3.3.3"
|
|
20
|
+
}
|
|
21
|
+
}
|