@skilbjo/config-rc 1.0.12
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/.depcheckrc +7 -0
- package/.eslintrc.cjs +88 -0
- package/.github/dependabot.yml +48 -0
- package/.github/workflows/pr.yml +75 -0
- package/.github/workflows/release.yml +69 -0
- package/.husky/commit-msg +4 -0
- package/.nvmrc +1 -0
- package/.releaserc +20 -0
- package/CHANGELOG.md +38 -0
- package/Makefile +38 -0
- package/README.md +5 -0
- package/index.js +7 -0
- package/package.json +61 -0
- package/target/install +0 -0
- package/target/lint +0 -0
- package/test/a.ts +5 -0
- package/test/lint-playground.ts +40 -0
- package/tsconfig.json +41 -0
package/.depcheckrc
ADDED
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
es6: true,
|
|
4
|
+
'jest/globals': true,
|
|
5
|
+
node: true,
|
|
6
|
+
},
|
|
7
|
+
extends: [
|
|
8
|
+
'prettier',
|
|
9
|
+
'typescript',
|
|
10
|
+
'eslint:recommended',
|
|
11
|
+
'plugin:node/recommended',
|
|
12
|
+
'plugin:prettier/recommended',
|
|
13
|
+
'plugin:import/recommended',
|
|
14
|
+
'plugin:import/typescript',
|
|
15
|
+
'plugin:@typescript-eslint/recommended',
|
|
16
|
+
'plugin:@typescript-eslint/strict',
|
|
17
|
+
'plugin:typescript-sort-keys/recommended',
|
|
18
|
+
'plugin:security/recommended-legacy',
|
|
19
|
+
],
|
|
20
|
+
globals: {
|
|
21
|
+
Atomics: 'readonly',
|
|
22
|
+
SharedArrayBuffer: 'readonly',
|
|
23
|
+
},
|
|
24
|
+
parser: '@typescript-eslint/parser',
|
|
25
|
+
parserOptions: {
|
|
26
|
+
ecmaVersion: 2022,
|
|
27
|
+
project: './tsconfig.json',
|
|
28
|
+
sourceType: 'module',
|
|
29
|
+
},
|
|
30
|
+
plugins: [
|
|
31
|
+
'prettier',
|
|
32
|
+
'import',
|
|
33
|
+
'jest',
|
|
34
|
+
'sort-keys-fix',
|
|
35
|
+
'typescript-sort-keys',
|
|
36
|
+
'@typescript-eslint',
|
|
37
|
+
],
|
|
38
|
+
reportUnusedDisableDirectives: true,
|
|
39
|
+
rules: {
|
|
40
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
41
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
42
|
+
'@typescript-eslint/no-misused-promises': 'error',
|
|
43
|
+
'@typescript-eslint/no-non-null-assertion': 1,
|
|
44
|
+
'@typescript-eslint/no-unused-vars': 1,
|
|
45
|
+
eqeqeq: 2,
|
|
46
|
+
'import/default': 2,
|
|
47
|
+
'import/export': 2,
|
|
48
|
+
'import/named': 2,
|
|
49
|
+
'import/namespace': 2,
|
|
50
|
+
'import/newline-after-import': 2,
|
|
51
|
+
'import/no-duplicates': 2,
|
|
52
|
+
'import/no-unresolved': 2,
|
|
53
|
+
'import/order': 2,
|
|
54
|
+
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 0 }],
|
|
55
|
+
'node/no-missing-import': 'off', // conflicts with typescript absolute imports
|
|
56
|
+
'node/no-unsupported-features/es-syntax': 'off',
|
|
57
|
+
'node/shebang': 'off',
|
|
58
|
+
'prettier/prettier': [
|
|
59
|
+
'error',
|
|
60
|
+
{
|
|
61
|
+
arrowParens: 'always',
|
|
62
|
+
printWidth: 80,
|
|
63
|
+
semi: true,
|
|
64
|
+
singleQuote: true,
|
|
65
|
+
tabWidth: 2,
|
|
66
|
+
trailingComma: 'es5',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
'security/detect-object-injection': 'off',
|
|
70
|
+
'sort-keys-fix/sort-keys-fix': 'warn',
|
|
71
|
+
'typescript-sort-keys/interface': 'warn',
|
|
72
|
+
},
|
|
73
|
+
settings: {
|
|
74
|
+
'import/parsers': {
|
|
75
|
+
'@typescript-eslint/parser': ['.ts'],
|
|
76
|
+
},
|
|
77
|
+
'import/resolver': {
|
|
78
|
+
node: { extensions: ['.ts', '.js'] }, // leave this
|
|
79
|
+
typescript: {
|
|
80
|
+
alwaysTryTypes: true,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
node: {
|
|
84
|
+
resolvePaths: ['node_modules/@types'],
|
|
85
|
+
tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts'],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
registries:
|
|
4
|
+
npm-github:
|
|
5
|
+
type: npm-registry
|
|
6
|
+
url: https://npm.pkg.github.com
|
|
7
|
+
token: ${{ secrets.READ_ONLY_PAT }}
|
|
8
|
+
|
|
9
|
+
updates:
|
|
10
|
+
- package-ecosystem: npm
|
|
11
|
+
registries:
|
|
12
|
+
- npm-github
|
|
13
|
+
directory: /
|
|
14
|
+
schedule:
|
|
15
|
+
interval: weekly
|
|
16
|
+
assignees:
|
|
17
|
+
- skilbjo
|
|
18
|
+
rebase-strategy: auto
|
|
19
|
+
ignore:
|
|
20
|
+
- dependency-name: aws-sdk
|
|
21
|
+
- dependency-name: '@aws-sdk/*'
|
|
22
|
+
- dependency-name: devtools-protocol
|
|
23
|
+
- dependency-name: husky
|
|
24
|
+
- dependency-name: '@aws-sdk/client-dynamodb'
|
|
25
|
+
- dependency-name: '@aws-sdk/lib-dynamodb'
|
|
26
|
+
- dependency-name: '@aws-sdk/util-dynamodb'
|
|
27
|
+
- dependency-name: '@commitlint/cli'
|
|
28
|
+
- dependency-name: '@commitlint/config-angular'
|
|
29
|
+
|
|
30
|
+
- dependency-name: eslint
|
|
31
|
+
- dependency-name: eslint-config-prettier
|
|
32
|
+
- dependency-name: eslint-config-typescript
|
|
33
|
+
versioning-strategy: increase
|
|
34
|
+
open-pull-requests-limit: 15
|
|
35
|
+
commit-message:
|
|
36
|
+
prefix: fix
|
|
37
|
+
include: scope
|
|
38
|
+
|
|
39
|
+
- package-ecosystem: github-actions
|
|
40
|
+
directory: /
|
|
41
|
+
schedule:
|
|
42
|
+
interval: weekly
|
|
43
|
+
assignees:
|
|
44
|
+
- skilbjo
|
|
45
|
+
open-pull-requests-limit: 5
|
|
46
|
+
commit-message:
|
|
47
|
+
prefix: fix
|
|
48
|
+
include: scope
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: pr
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target: # https://github.com/dependabot/dependabot-core/issues/3253
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
defaults:
|
|
9
|
+
run:
|
|
10
|
+
shell: bash
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
pull-requests: write
|
|
14
|
+
contents: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build-and-test:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 10
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
ref: ${{ github.event.pull_request.head.sha }}
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version-file: .nvmrc
|
|
28
|
+
cache: npm
|
|
29
|
+
|
|
30
|
+
- run: npm install
|
|
31
|
+
env:
|
|
32
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
33
|
+
|
|
34
|
+
- run: make ci
|
|
35
|
+
env:
|
|
36
|
+
GITHUB_TOKEN: ${{ secrets.READ_ONLY_PAT }}
|
|
37
|
+
NPM_TOKEN: ${{ secrets.READ_ONLY_PAT }}
|
|
38
|
+
NODE_AUTH_TOKEN: ${{ secrets.READ_ONLY_PAT }}
|
|
39
|
+
|
|
40
|
+
- name: Set up NPM authentication for dry release
|
|
41
|
+
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.ACTIONS_TOKEN }}" >> ~/.npmrc
|
|
42
|
+
|
|
43
|
+
- uses: cycjimmy/semantic-release-action@v4.1.1
|
|
44
|
+
id: semantic # need an `id` for output variables
|
|
45
|
+
with:
|
|
46
|
+
dry_run: true
|
|
47
|
+
semantic_version: 18
|
|
48
|
+
extra_plugins: |
|
|
49
|
+
@semantic-release/git@10.0.1
|
|
50
|
+
@semantic-release/changelog@6.0.0
|
|
51
|
+
@semantic-release/exec@6.0.1
|
|
52
|
+
env:
|
|
53
|
+
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
|
|
54
|
+
NPM_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
|
|
55
|
+
NODE_AUTH_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
|
|
56
|
+
|
|
57
|
+
dependabot-approve-and-automerge:
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
needs: build-and-test
|
|
60
|
+
timeout-minutes: 2
|
|
61
|
+
if: ${{ github.actor == 'dependabot[bot]' }}
|
|
62
|
+
steps:
|
|
63
|
+
- uses: dependabot/fetch-metadata@v2.2.0
|
|
64
|
+
with:
|
|
65
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
66
|
+
- name: Approve a PR
|
|
67
|
+
run: gh pr review --approve "$PR_URL"
|
|
68
|
+
env:
|
|
69
|
+
PR_URL: ${{github.event.pull_request.html_url}}
|
|
70
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
71
|
+
- name: Enable auto-merge for Dependabot PRs
|
|
72
|
+
run: gh pr merge --auto --squash "$PR_URL"
|
|
73
|
+
env:
|
|
74
|
+
PR_URL: ${{github.event.pull_request.html_url}}
|
|
75
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
defaults:
|
|
9
|
+
run:
|
|
10
|
+
shell: bash
|
|
11
|
+
|
|
12
|
+
# uses: lhotari/action-upterm@v1 # if ssh is needed
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
publish-artifact:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
timeout-minutes: 10
|
|
18
|
+
|
|
19
|
+
outputs:
|
|
20
|
+
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
|
|
21
|
+
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
token: ${{ secrets.ACTIONS_TOKEN }}
|
|
28
|
+
|
|
29
|
+
- uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version-file: .nvmrc
|
|
32
|
+
cache: npm
|
|
33
|
+
|
|
34
|
+
- run: npm ci
|
|
35
|
+
env:
|
|
36
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
37
|
+
|
|
38
|
+
- run: make ci
|
|
39
|
+
|
|
40
|
+
- uses: cycjimmy/semantic-release-action@v4.1.1
|
|
41
|
+
id: semantic # need an `id` for output variables
|
|
42
|
+
with:
|
|
43
|
+
semantic_version: 18
|
|
44
|
+
extra_plugins: |
|
|
45
|
+
@semantic-release/git@10.0.1
|
|
46
|
+
@semantic-release/changelog@6.0.0
|
|
47
|
+
@semantic-release/exec@6.0.1
|
|
48
|
+
env:
|
|
49
|
+
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
|
|
50
|
+
NPM_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
|
|
51
|
+
NODE_AUTH_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
|
|
52
|
+
|
|
53
|
+
- name: prepare npm
|
|
54
|
+
run: |
|
|
55
|
+
# npm --no-git-tag-version version ${{ steps.semantic.outputs.new_release_version }}
|
|
56
|
+
jq 'del(.repository, .publishConfig) | . + { publishConfig: { registry: "https://registry.npmjs.org/" } }' package.json >package2.json && mv package2.json package.json
|
|
57
|
+
|
|
58
|
+
- name: Publish to NPM
|
|
59
|
+
if: steps.semantic.outputs.new_release_published == 'true'
|
|
60
|
+
uses: JS-DevTools/npm-publish@v3
|
|
61
|
+
with:
|
|
62
|
+
token: ${{ secrets.NPM_TOKEN }}
|
|
63
|
+
access: public
|
|
64
|
+
|
|
65
|
+
# - name: Push updates to branch for major version
|
|
66
|
+
# # if there is a new version published, let's say v1.2.3
|
|
67
|
+
# # then this step will update branch "v1" to this commit
|
|
68
|
+
# if: steps.semantic.outputs.new_release_published == 'true'
|
|
69
|
+
# run: "git push https://x-access-token:${{ secrets.ACTIONS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}"
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v20
|
package/.releaserc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": [
|
|
3
|
+
"@semantic-release/commit-analyzer",
|
|
4
|
+
"@semantic-release/release-notes-generator",
|
|
5
|
+
["@semantic-release/changelog", {
|
|
6
|
+
"changelogFile": "CHANGELOG.md"
|
|
7
|
+
}],
|
|
8
|
+
["@semantic-release/exec", {
|
|
9
|
+
"verifyConditionsCmd": "make ci",
|
|
10
|
+
}],
|
|
11
|
+
["@semantic-release/github", {
|
|
12
|
+
assets: [".eslintrc.js", "index.js"]
|
|
13
|
+
}],
|
|
14
|
+
["@semantic-release/npm"],
|
|
15
|
+
["@semantic-release/git", {
|
|
16
|
+
"assets": ["CHANGELOG.md"],
|
|
17
|
+
"message": "docs(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
18
|
+
}]
|
|
19
|
+
]
|
|
20
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
## [1.0.12](https://github.com/skilbjo/config-rc/compare/v1.0.11...v1.0.12) (2024-10-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **ci:** config ([0198779](https://github.com/skilbjo/config-rc/commit/0198779dbbe84d2afcf4035d32c7c0676f2037de))
|
|
7
|
+
|
|
8
|
+
## [1.0.11](https://github.com/skilbjo/config-rc/compare/v1.0.10...v1.0.11) (2024-10-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **ci:** config ([3a7931c](https://github.com/skilbjo/config-rc/commit/3a7931c97a30d9a2fa75d8d72c09a84bd06605c3))
|
|
14
|
+
|
|
15
|
+
## [1.0.10](https://github.com/skilbjo/config-rc/compare/v1.0.9...v1.0.10) (2024-10-05)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **ci:** publish to npm ([11230a3](https://github.com/skilbjo/config-rc/commit/11230a3aa26cede7f53db260424af10fd52b8f05))
|
|
21
|
+
* **deps-dev:** bump @types/node from 22.5.4 to 22.5.5 ([#150](https://github.com/skilbjo/config-rc/issues/150)) ([a501e0d](https://github.com/skilbjo/config-rc/commit/a501e0de2de7f17f456c9fa601c220c3476b6de8))
|
|
22
|
+
* **deps-dev:** bump @types/node from 22.5.5 to 22.7.4 ([#156](https://github.com/skilbjo/config-rc/issues/156)) ([9fa1d99](https://github.com/skilbjo/config-rc/commit/9fa1d991e660dde44c29b4df0edab0e3027fce98))
|
|
23
|
+
* **deps:** bump cycjimmy/semantic-release-action from 4.1.0 to 4.1.1 ([#157](https://github.com/skilbjo/config-rc/issues/157)) ([e30b975](https://github.com/skilbjo/config-rc/commit/e30b975b4ae502ddfbd828f0611e3e7b42a0db75))
|
|
24
|
+
* **deps:** bump typescript from 5.5.4 to 5.6.2 ([#153](https://github.com/skilbjo/config-rc/issues/153)) ([4a7966c](https://github.com/skilbjo/config-rc/commit/4a7966cdda3b74ee3f4630c8a3053c93b061fae9))
|
|
25
|
+
|
|
26
|
+
## [1.0.9](https://github.com/skilbjo/config-rc/compare/v1.0.8...v1.0.9) (2024-09-16)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* **deps-dev:** bump @types/node from 22.5.0 to 22.5.2 ([#143](https://github.com/skilbjo/config-rc/issues/143)) ([c26df26](https://github.com/skilbjo/config-rc/commit/c26df26da4450137a1f11032a72cbe71885068e4))
|
|
32
|
+
* **deps-dev:** bump @types/node from 22.5.2 to 22.5.4 ([#148](https://github.com/skilbjo/config-rc/issues/148)) ([d0da695](https://github.com/skilbjo/config-rc/commit/d0da6950eff67e00697a5187cbf447a2f4b3bb51))
|
|
33
|
+
* **deps:** bump eslint-import-resolver-typescript from 3.6.1 to 3.6.3 ([#140](https://github.com/skilbjo/config-rc/issues/140)) ([398236b](https://github.com/skilbjo/config-rc/commit/398236bd18b3187b41e1fee4adceb84b9da224ab))
|
|
34
|
+
* **deps:** bump eslint-plugin-import from 2.29.1 to 2.30.0 ([#147](https://github.com/skilbjo/config-rc/issues/147)) ([ab03db0](https://github.com/skilbjo/config-rc/commit/ab03db09d48ffcc426486f392553f88c8a41a788))
|
|
35
|
+
* **deps:** bump eslint-plugin-jest from 28.8.0 to 28.8.1 ([#141](https://github.com/skilbjo/config-rc/issues/141)) ([8ff86fa](https://github.com/skilbjo/config-rc/commit/8ff86faecf088170ec9ff2611b587bcbaeda22b0))
|
|
36
|
+
* **deps:** bump eslint-plugin-jest from 28.8.1 to 28.8.2 ([#145](https://github.com/skilbjo/config-rc/issues/145)) ([48be29e](https://github.com/skilbjo/config-rc/commit/48be29ecefdf50cb2ef47218a625970feaeea083))
|
|
37
|
+
* **deps:** bump eslint-plugin-jest from 28.8.2 to 28.8.3 ([#149](https://github.com/skilbjo/config-rc/issues/149)) ([2642f3e](https://github.com/skilbjo/config-rc/commit/2642f3e8ae7fed4f87128004b3e1b47b818b0545))
|
|
38
|
+
* **deps:** bump typescript from 5.4.4 to 5.5.4 ([#142](https://github.com/skilbjo/config-rc/issues/142)) ([9565cce](https://github.com/skilbjo/config-rc/commit/9565cceeab3b8832033caba2de45a4e716a1b2dd))
|
package/Makefile
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
SHELL := bash
|
|
2
|
+
MAKEFLAGS += --warn-undefined-variables
|
|
3
|
+
|
|
4
|
+
.DELETE_ON_ERROR:
|
|
5
|
+
|
|
6
|
+
.DEFAULT_GOAL := ci
|
|
7
|
+
is_ci := $(shell if [ ! -z "$(CODEBUILD_BUILD_ARN)" ] || [ ! -z "$(GITHUB_ACTIONS)" ]; then echo 'true'; else echo 'false'; fi)
|
|
8
|
+
git_sha := $(shell if [ ! -z "$(CODEBUILD_RESOLVED_SOURCE_VERSION)" ]; then echo "$(CODEBUILD_RESOLVED_SOURCE_VERSION)"; else git rev-parse --short HEAD; fi)
|
|
9
|
+
|
|
10
|
+
very-clean: clean
|
|
11
|
+
rm -rf dist target node_modules/ package-lock.json
|
|
12
|
+
.PHONY: very-clean
|
|
13
|
+
|
|
14
|
+
clean:
|
|
15
|
+
rm -rf dist target/lint
|
|
16
|
+
.PHONY: clean
|
|
17
|
+
|
|
18
|
+
install: | target/install
|
|
19
|
+
target/install:
|
|
20
|
+
ifeq ($(is_ci), true)
|
|
21
|
+
npm ci
|
|
22
|
+
else
|
|
23
|
+
npm install
|
|
24
|
+
endif
|
|
25
|
+
mkdir -p $(@D) && touch $@
|
|
26
|
+
.PHONY: install
|
|
27
|
+
|
|
28
|
+
lint: | install target/lint
|
|
29
|
+
target/lint:
|
|
30
|
+
npm run lint
|
|
31
|
+
npm run depcheck
|
|
32
|
+
mkdir -p $(@D) && touch $@
|
|
33
|
+
.PHONY: lint
|
|
34
|
+
|
|
35
|
+
# --- ci
|
|
36
|
+
|
|
37
|
+
ci: | install lint
|
|
38
|
+
.PHONY: ci
|
package/README.md
ADDED
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package",
|
|
3
|
+
"name": "@skilbjo/config-rc",
|
|
4
|
+
"version": "1.0.12",
|
|
5
|
+
"description": "eslint, prettier, & tsconfig config",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepare": "if [[ -z $GITHUB_ACTIONS ]]; then npx husky install; fi",
|
|
9
|
+
"eslint": "eslint .",
|
|
10
|
+
"lint": "npm run eslint",
|
|
11
|
+
"depcheck": "depcheck",
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"eslint",
|
|
16
|
+
"eslintrc"
|
|
17
|
+
],
|
|
18
|
+
"author": "skilbjo",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/skilbjo/config-rc/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/skilbjo/config-rc#readme",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@tsconfig/node20": "20.1.4",
|
|
26
|
+
"@types/jest": "29.5.12",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "7.17.0",
|
|
28
|
+
"@typescript-eslint/parser": "7.18.0",
|
|
29
|
+
"eslint": "8.57.0",
|
|
30
|
+
"eslint-config-prettier": "9.1.0",
|
|
31
|
+
"eslint-config-typescript": "3.0.0",
|
|
32
|
+
"eslint-import-resolver-typescript": "3.6.3",
|
|
33
|
+
"eslint-plugin-import": "2.30.0",
|
|
34
|
+
"eslint-plugin-jest": "28.8.3",
|
|
35
|
+
"eslint-plugin-node": "11.1.0",
|
|
36
|
+
"eslint-plugin-prettier": "5.2.1",
|
|
37
|
+
"eslint-plugin-sort-keys-fix": "1.1.2",
|
|
38
|
+
"eslint-plugin-typescript-sort-keys": "3.2.0",
|
|
39
|
+
"eslint-plugin-security": "3.0.1",
|
|
40
|
+
"prettier": "3.3.3",
|
|
41
|
+
"typescript": "5.6.2"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@commitlint/cli": "19.3.0",
|
|
45
|
+
"@commitlint/config-angular": "16.2.4",
|
|
46
|
+
"@types/node": "22.7.4",
|
|
47
|
+
"depcheck": "1.4.7",
|
|
48
|
+
"husky": "8.0.1"
|
|
49
|
+
},
|
|
50
|
+
"commitlint": {
|
|
51
|
+
"extends": [
|
|
52
|
+
"@commitlint/config-angular"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=16.0.0"
|
|
57
|
+
},
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"registry": "https://registry.npmjs.org/"
|
|
60
|
+
}
|
|
61
|
+
}
|
package/target/install
ADDED
|
File without changes
|
package/target/lint
ADDED
|
File without changes
|
package/test/a.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
|
|
4
|
+
import * as a from './a';
|
|
5
|
+
import { one } from './a';
|
|
6
|
+
|
|
7
|
+
type Foo = {
|
|
8
|
+
a: number;
|
|
9
|
+
b: number;
|
|
10
|
+
c: number;
|
|
11
|
+
};
|
|
12
|
+
type MaybePresent = { a: number[]; b?: { c: string } };
|
|
13
|
+
|
|
14
|
+
const f: Foo = {
|
|
15
|
+
a: 3,
|
|
16
|
+
b: 2,
|
|
17
|
+
c: 1,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const numberArr: Array<number> = [
|
|
21
|
+
1, 2, 3, 4, 444444, 54353454325243, 543254325324, 54325432543523,
|
|
22
|
+
1312312321312312,
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const maybePresent: MaybePresent = {
|
|
26
|
+
a: [123],
|
|
27
|
+
};
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const isPresent: MaybePresent = {
|
|
30
|
+
a: [123],
|
|
31
|
+
b: { c: 'yodawg' },
|
|
32
|
+
};
|
|
33
|
+
const cUndefined = maybePresent.b?.c;
|
|
34
|
+
const cDefined = maybePresent.b!.c; // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
35
|
+
|
|
36
|
+
console.log(f, fs, path);
|
|
37
|
+
console.log(a, one);
|
|
38
|
+
console.log({ numberArr });
|
|
39
|
+
console.log({ cUndefined });
|
|
40
|
+
console.log({ cDefined });
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"display": "Node 20",
|
|
4
|
+
"_version": "20.1.3",
|
|
5
|
+
"extends": "@tsconfig/node20/tsconfig.json",
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"module": "CommonJS",
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"target": "ES2022",
|
|
10
|
+
"lib": [
|
|
11
|
+
"ES2023"
|
|
12
|
+
],
|
|
13
|
+
|
|
14
|
+
"outDir": "dist",
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noImplicitReturns": true,
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"inlineSources": true,
|
|
21
|
+
"inlineSourceMap": true,
|
|
22
|
+
"strict": true,
|
|
23
|
+
"typeRoots": [
|
|
24
|
+
"./node_modules/@types"
|
|
25
|
+
],
|
|
26
|
+
"types": [
|
|
27
|
+
"jest",
|
|
28
|
+
"node"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"include": [
|
|
32
|
+
"src/**/*.ts",
|
|
33
|
+
"test/**/*.ts",
|
|
34
|
+
".eslintrc.cjs",
|
|
35
|
+
"index.js"
|
|
36
|
+
],
|
|
37
|
+
"exclude": [
|
|
38
|
+
"node_modules",
|
|
39
|
+
"dist"
|
|
40
|
+
]
|
|
41
|
+
}
|