@widergy/eslint-config 1.0.5 → 1.1.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/.circleci/config.yml +23 -2
- package/CHANGELOG.md +19 -9
- package/README.md +76 -4
- package/package.json +3 -2
- package/scripts/aws-configure.sh +6 -0
package/.circleci/config.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
version: 2
|
|
1
|
+
version: 2.1
|
|
2
2
|
|
|
3
3
|
aliases:
|
|
4
4
|
- &widergy-context
|
|
@@ -11,9 +11,30 @@ jobs:
|
|
|
11
11
|
- image: cimg/node:22.18.0
|
|
12
12
|
steps:
|
|
13
13
|
- checkout
|
|
14
|
+
- run:
|
|
15
|
+
name: Set git credentials
|
|
16
|
+
command: git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
|
|
14
17
|
- run: yarn install
|
|
15
|
-
|
|
16
18
|
- run: npx semantic-release
|
|
19
|
+
- run:
|
|
20
|
+
name: Install and configure AWS CLI
|
|
21
|
+
command: yarn aws-configure
|
|
22
|
+
- run:
|
|
23
|
+
name: Publish to CodeArtifact
|
|
24
|
+
command: |
|
|
25
|
+
CODEARTIFACT_TOKEN=$(AWS_ACCESS_KEY_ID=$WIDERGYAPP_AWS_ACCESS_KEY_ID \
|
|
26
|
+
AWS_SECRET_ACCESS_KEY=$WIDERGYAPP_AWS_SECRET_ACCESS_KEY \
|
|
27
|
+
aws codeartifact get-authorization-token \
|
|
28
|
+
--domain $CODEARTIFACT_DOMAIN \
|
|
29
|
+
--domain-owner $CODEARTIFACT_DOMAIN_OWNER \
|
|
30
|
+
--region us-east-1 \
|
|
31
|
+
--query authorizationToken \
|
|
32
|
+
--output text)
|
|
33
|
+
CODEARTIFACT_HOST="${CODEARTIFACT_URL#https://}"
|
|
34
|
+
printf "registry=%s/npm/npm/\n//%s/npm/npm/:_authToken=%s\n" \
|
|
35
|
+
"$CODEARTIFACT_URL" "$CODEARTIFACT_HOST" "$CODEARTIFACT_TOKEN" \
|
|
36
|
+
> /tmp/codeartifact.npmrc
|
|
37
|
+
npm publish --userconfig /tmp/codeartifact.npmrc
|
|
17
38
|
|
|
18
39
|
|
|
19
40
|
workflows:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
# [1.1.0](https://github.com/widergy/eslint-config/compare/v1.0.6...v1.1.0) (2026-08-25)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* codeartifact publish step ([340f4eb](https://github.com/widergy/eslint-config/commit/340f4eb1842cf9a567485b6dd8b95755b881dbe0))
|
|
7
7
|
|
|
8
|
-
## [1.0.
|
|
8
|
+
## [1.0.6](https://github.com/widergy/eslint-config/compare/v1.0.5...v1.0.6) (2026-04-16)
|
|
9
9
|
|
|
10
|
+
### Novedades y Mejoras
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
* Mejoras internas de la plataforma [`489b124`](https://github.com/widergy/eslint-config/commit/489b124) [`ca146b3`](https://github.com/widergy/eslint-config/commit/ca146b3)
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
## [1.0.5](https://github.com/widergy/eslint-config/compare/v1.0.4...v1.0.5) (2026-02-12)
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
### Correcciones
|
|
16
17
|
|
|
18
|
+
* Se corrigieron problemas en la configuración de análisis de código que podían generar errores inesperados durante el desarrollo de proyectos JavaScript, React y React Native. [#14](https://github.com/widergy/eslint-config/pull/14) [DEV-766](https://widergy.atlassian.net/browse/DEV-766)
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
## [1.0.4](https://github.com/widergy/eslint-config/compare/v1.0.3...v1.0.4) (2026-02-11)
|
|
21
|
+
|
|
22
|
+
### Correcciones
|
|
23
|
+
|
|
24
|
+
* Mejoras internas de la plataforma [#13](https://github.com/widergy/eslint-config/pull/13) [DEV-766](https://widergy.atlassian.net/browse/DEV-766)
|
|
25
|
+
|
|
26
|
+
## [1.0.3](https://github.com/widergy/eslint-config/compare/v1.0.2...v1.0.3) (2026-02-10)
|
|
27
|
+
|
|
28
|
+
### Novedades y Mejoras
|
|
19
29
|
|
|
20
|
-
*
|
|
30
|
+
* Mejoras internas de la plataforma [#12](https://github.com/widergy/eslint-config/pull/12) [DEV-766](https://widergy.atlassian.net/browse/DEV-766)
|
|
21
31
|
|
|
22
32
|
## [1.0.2](https://github.com/widergy/eslint-config/compare/v1.0.1...v1.0.2) (2025-12-18)
|
|
23
33
|
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ To handle retrocompatibility with previous errors and avoid blocking the migrati
|
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
"scripts": {
|
|
34
|
-
"lint-suppress": "eslint src --
|
|
34
|
+
"lint-suppress": "eslint src --suppress-all"
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -40,21 +40,93 @@ To handle retrocompatibility with previous errors and avoid blocking the migrati
|
|
|
40
40
|
- **Do not run this daily**. Only use it when you change rules and want to ignore new legacy errors.
|
|
41
41
|
|
|
42
42
|
2. **Update `lint` script**:
|
|
43
|
-
Modify your `lint` script to
|
|
43
|
+
Modify your `lint` script to prune unused suppressions:
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
46
|
"scripts": {
|
|
47
|
-
"lint": "eslint src --
|
|
47
|
+
"lint": "eslint src --prune-suppressions"
|
|
48
48
|
}
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
- `--cache`: Speeds up future linting processes. **Add `.eslintcache` to your `.gitignore`**.
|
|
52
51
|
- `--prune-suppressions`: Automatically removes suppressions for rules that are no longer violated.
|
|
53
52
|
|
|
54
53
|
3. **Git Hooks**:
|
|
55
54
|
- It is recommended to run the linting process in the **`prepush`** hook of your repository.
|
|
56
55
|
- If you are currently using `precommit`, consider moving it to `prepush` to avoid slowing down commits.
|
|
57
56
|
|
|
57
|
+
## CircleCI
|
|
58
|
+
|
|
59
|
+
The linter runs on CircleCI as a dedicated `pr-checks` pipeline, separate from the main deploy pipeline. It is triggered on demand by commenting `run-ci` on a pull request — no CI minutes are spent on every push.
|
|
60
|
+
|
|
61
|
+
### Lint job (`pr-checks.yml`)
|
|
62
|
+
|
|
63
|
+
Create `.circleci/pr-checks.yml`. Replace `<NODE_VERSION>` with the Node.js version your project uses (e.g. `20.19`). If your project requires syncing gitignored assets or loading config files before linting (e.g. via `yarn sync` or `yarn loadConfig`), add those steps before `Run lint`.
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
version: 2.1
|
|
67
|
+
|
|
68
|
+
commands:
|
|
69
|
+
cache-yarn:
|
|
70
|
+
steps:
|
|
71
|
+
- restore_cache:
|
|
72
|
+
keys:
|
|
73
|
+
- yarn-deps-{{ checksum "yarn.lock" }}
|
|
74
|
+
- run: yarn install --frozen-lockfile
|
|
75
|
+
- save_cache:
|
|
76
|
+
paths:
|
|
77
|
+
- ~/.cache/yarn
|
|
78
|
+
key: yarn-deps-{{ checksum "yarn.lock" }}
|
|
79
|
+
|
|
80
|
+
jobs:
|
|
81
|
+
lint:
|
|
82
|
+
docker:
|
|
83
|
+
- image: cimg/node:<NODE_VERSION>
|
|
84
|
+
steps:
|
|
85
|
+
- checkout
|
|
86
|
+
- cache-yarn
|
|
87
|
+
- run:
|
|
88
|
+
name: Run lint
|
|
89
|
+
command: yarn lint
|
|
90
|
+
|
|
91
|
+
workflows:
|
|
92
|
+
pr-checks:
|
|
93
|
+
jobs:
|
|
94
|
+
- lint
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### CircleCI pipeline setup
|
|
98
|
+
|
|
99
|
+
Once `pr-checks.yml` is merged to the default branch, configure a new pipeline in CircleCI using the GitHub App integration:
|
|
100
|
+
|
|
101
|
+
1. In the [CircleCI app](https://app.circleci.com), open the project and go to **Project Settings → Project Setup**.
|
|
102
|
+
2. Click **Add GitHub Pipeline**.
|
|
103
|
+
3. Set **Config filepath** to `.circleci/pr-checks.yml` (leave Config source and Checkout source as the repo default).
|
|
104
|
+
4. Under **Trigger on...**, click **GitHub trigger +** and configure:
|
|
105
|
+
- **Trigger event**: PR comment
|
|
106
|
+
- **Comment text**: `run-ci` (exact match)
|
|
107
|
+
5. Save.
|
|
108
|
+
|
|
109
|
+
> [!NOTE]
|
|
110
|
+
> This creates a pipeline completely independent from the main `config.yml` deploy pipeline. It only runs when the exact comment `run-ci` is posted on a PR. The trigger uses CircleCI's native GitHub App integration — no additional GitHub Actions workflow is needed.
|
|
111
|
+
|
|
112
|
+
## Repositories with CircleCI lint configured
|
|
113
|
+
|
|
114
|
+
The following repositories have `.circleci/pr-checks.yml` and the CircleCI pipeline already set up. **Update this list when the setup is completed in a new repository.**
|
|
115
|
+
|
|
116
|
+
| Repository | Type |
|
|
117
|
+
|---|---|
|
|
118
|
+
| [AgentGO-Chat-Web](https://github.com/widergy/AgentGO-Chat-Web) | App |
|
|
119
|
+
| [AgentGO-Backoffice-Web](https://github.com/widergy/AgentGO-Backoffice-Web) | App |
|
|
120
|
+
| [Customer-Hub-Web](https://github.com/widergy/Customer-Hub-Web) | App |
|
|
121
|
+
| [UtilityGO-Office-Mobile](https://github.com/widergy/UtilityGO-Office-Mobile) | App |
|
|
122
|
+
| [UtilityGO-Office-Web](https://github.com/widergy/UtilityGO-Office-Web) | App |
|
|
123
|
+
| [UtilityGO-Totem-Web](https://github.com/widergy/UtilityGO-Totem-Web) | App |
|
|
124
|
+
| [Energy-UI](https://github.com/widergy/Energy-UI) | Library |
|
|
125
|
+
| [Energy-UI-Mobile](https://github.com/widergy/Energy-UI-Mobile) | Library |
|
|
126
|
+
| [UtilityGO-Smart-Bill-Mobile](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile) | Library |
|
|
127
|
+
| [UtilityGO-Smart-Bill-Web](https://github.com/widergy/UtilityGO-Smart-Bill-Web) | Library |
|
|
128
|
+
| [web-utils](https://github.com/widergy/web-utils) | Library |
|
|
129
|
+
|
|
58
130
|
## Usage
|
|
59
131
|
|
|
60
132
|
Import the specific configuration based on your project type in your `eslint.config.js` file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widergy/eslint-config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Widergy ESLint configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "widergy",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"widergy"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"lint": "eslint ."
|
|
24
|
+
"lint": "eslint .",
|
|
25
|
+
"aws-configure": "bash scripts/aws-configure.sh"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
28
|
"@babel/core": "^7.22.10",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
|
2
|
+
unzip awscliv2.zip
|
|
3
|
+
sudo ./aws/install
|
|
4
|
+
aws configure set aws_access_key_id $WIDERGYAPP_AWS_ACCESS_KEY_ID
|
|
5
|
+
aws configure set aws_secret_access_key $WIDERGYAPP_AWS_SECRET_ACCESS_KEY
|
|
6
|
+
aws configure set default.region us-east-1
|