@book000/eslint-config 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/.github/workflows/nodejs-ci-pnpm.yml +18 -0
- package/.github/workflows/release.yml +84 -0
- package/.node-version +1 -0
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/index.mjs +60 -0
- package/package.json +31 -0
- package/renovate.json +3 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Node.js でビルド・テストを実行する。バージョンは .node-version に記載されているものを利用する
|
|
2
|
+
|
|
3
|
+
name: Node CI
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
- master
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
|
+
- master
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
node-ci:
|
|
17
|
+
name: Node CI
|
|
18
|
+
uses: book000/templates/.github/workflows/reusable-nodejs-ci-pnpm.yml@master
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
types:
|
|
9
|
+
- closed
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
release:
|
|
16
|
+
name: Release
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
if: github.event.pull_request.merged == true
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: 🛎 Checkout
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
|
|
26
|
+
- name: 🏗 Setup node
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version-file: .node-version
|
|
30
|
+
registry-url: 'https://registry.npmjs.org'
|
|
31
|
+
|
|
32
|
+
- name: Setup pnpm
|
|
33
|
+
uses: pnpm/action-setup@v2
|
|
34
|
+
id: pnpm-install
|
|
35
|
+
with:
|
|
36
|
+
run_install: false
|
|
37
|
+
|
|
38
|
+
- name: 📂 Get pnpm store directory
|
|
39
|
+
id: pnpm-cache
|
|
40
|
+
shell: bash
|
|
41
|
+
run: |
|
|
42
|
+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
43
|
+
|
|
44
|
+
- name: 📂 Setup pnpm cache
|
|
45
|
+
uses: actions/cache@v4
|
|
46
|
+
with:
|
|
47
|
+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
48
|
+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
49
|
+
restore-keys: |
|
|
50
|
+
${{ runner.os }}-pnpm-store-
|
|
51
|
+
|
|
52
|
+
- name: 👨🏻💻 Install dependencies
|
|
53
|
+
run: |
|
|
54
|
+
pnpm install --frozen-lockfile --prefer-frozen-lockfile
|
|
55
|
+
|
|
56
|
+
- name: 🏷 Bump version and push tag
|
|
57
|
+
id: tag-version
|
|
58
|
+
uses: mathieudutour/github-tag-action@v6.2
|
|
59
|
+
with:
|
|
60
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
61
|
+
default_bump: 'minor'
|
|
62
|
+
custom_release_rules: 'feat:minor:✨ Features,fix:patch:🐛 Fixes,docs:patch:📰 Docs,chore:patch:🎨 Chore,pref:patch:🎈 Performance improvements,refactor:patch:🧹 Refactoring,build:patch:🔍 Build,ci:patch:🔍 CI,revert:patch:⏪ Revert,style:patch:🧹 Style,test:patch:👀 Test,release:major:📦 Release'
|
|
63
|
+
|
|
64
|
+
- name: 📝 Update package.json version
|
|
65
|
+
run: |
|
|
66
|
+
pnpm version --no-git-tag-version ${{ steps.tag-version.outputs.new_version }}
|
|
67
|
+
|
|
68
|
+
- name: 📦 Publish
|
|
69
|
+
run: |
|
|
70
|
+
pnpm publish --access public --no-git-checks
|
|
71
|
+
env:
|
|
72
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
73
|
+
|
|
74
|
+
- name: 📃 Create Release
|
|
75
|
+
id: create_release
|
|
76
|
+
uses: ncipollo/release-action@v1.14.0
|
|
77
|
+
env:
|
|
78
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
79
|
+
with:
|
|
80
|
+
tag: ${{ steps.tag-version.outputs.new_tag }}
|
|
81
|
+
name: ${{ steps.tag-version.outputs.new_tag }}
|
|
82
|
+
body: ${{ steps.tag-version.outputs.changelog }}
|
|
83
|
+
draft: false
|
|
84
|
+
prerelease: false
|
package/.node-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20.12.2
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Tomachi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @book000/eslint-config
|
|
2
|
+
|
|
3
|
+
ESLint config for [Tomachi (book000)](https://github.com/book000)
|
|
4
|
+
|
|
5
|
+
## 🚀 Install
|
|
6
|
+
|
|
7
|
+
If you are using npm:
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
npm install eslint eslint-config-standard @book000/eslint-config
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
or if you are using yarn:
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
yarn add eslint eslint-config-standard @book000/eslint-config
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
or if you are using pnpm:
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
pnpm add eslint eslint-config-standard @book000/eslint-config
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then, create `eslint.config.mjs` file and write the following:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
export { default } from '@book000/eslint-config'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 📑 License
|
|
32
|
+
|
|
33
|
+
This project is licensed under the [MIT License](LICENSE).
|
package/index.mjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
3
|
+
import tseslintParser from "@typescript-eslint/parser";
|
|
4
|
+
import eslintPrettier from "eslint-config-prettier";
|
|
5
|
+
import unicorn from "eslint-plugin-unicorn";
|
|
6
|
+
import globals from "globals";
|
|
7
|
+
import tseslint from "typescript-eslint";
|
|
8
|
+
|
|
9
|
+
const compat = new FlatCompat();
|
|
10
|
+
|
|
11
|
+
export default tseslint.config(
|
|
12
|
+
...compat.extends("eslint-config-standard"),
|
|
13
|
+
...tseslint.configs.recommended,
|
|
14
|
+
// @ts-expect-error flat/recommendedの返すpluginsがstring[]なことでエラーになるため
|
|
15
|
+
unicorn.configs["flat/recommended"],
|
|
16
|
+
{
|
|
17
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
globals: {
|
|
20
|
+
...globals.es2020,
|
|
21
|
+
...globals.node,
|
|
22
|
+
},
|
|
23
|
+
parser: tseslintParser,
|
|
24
|
+
parserOptions: {
|
|
25
|
+
project: ["tsconfig.json"],
|
|
26
|
+
ecmaVersion: "latest",
|
|
27
|
+
sourceType: "module",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
extends: [
|
|
31
|
+
...tseslint.configs.strictTypeChecked,
|
|
32
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
33
|
+
],
|
|
34
|
+
rules: {
|
|
35
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
36
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
37
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
38
|
+
"@typescript-eslint/restrict-template-expressions": [
|
|
39
|
+
"error",
|
|
40
|
+
{
|
|
41
|
+
allowNumber: true,
|
|
42
|
+
allowBoolean: true,
|
|
43
|
+
allowAny: true,
|
|
44
|
+
allowNullish: true,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
"@typescript-eslint/no-floating-promises": [
|
|
48
|
+
"error",
|
|
49
|
+
{
|
|
50
|
+
ignoreVoid: true,
|
|
51
|
+
ignoreIIFE: true,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
"unicorn/prefer-top-level-await": "off",
|
|
55
|
+
"unicorn/no-null": "off",
|
|
56
|
+
},
|
|
57
|
+
ignores: ["dist", "output", "node_modules", "data", "logs"],
|
|
58
|
+
},
|
|
59
|
+
eslintPrettier
|
|
60
|
+
);
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@book000/eslint-config",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "ESLint config",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"eslint-config"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/book000/eslint-config",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/book000/eslint-config/issues"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Tomachi <tomachi@tomacheese.com>",
|
|
14
|
+
"main": "index.mjs",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git@github.com:book000/eslint-config.git"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@eslint/eslintrc": "3.0.2",
|
|
21
|
+
"@typescript-eslint/parser": "7.7.0",
|
|
22
|
+
"eslint-config-prettier": "9.1.0",
|
|
23
|
+
"eslint-plugin-unicorn": "52.0.0",
|
|
24
|
+
"globals": "15.0.0",
|
|
25
|
+
"typescript-eslint": "7.7.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"eslint": "9.0.0",
|
|
29
|
+
"eslint-config-standard": "17.1.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/renovate.json
ADDED