Skip to content

Commit

Permalink
fix(*): setup all (#70)
Browse files Browse the repository at this point in the history
## Summary

<!-- Please summarize your changes. -->

<!-- Please link to any applicable information (forum posts, bug
reports, etc.). -->

## Checks

<!-- For completed items, change [ ] to [x]. -->

<!-- If you leave this checklist empty, your PR will very likely be
closed. -->

Please check the following:

- [x] I have written documents and tests, if needed.
  • Loading branch information
manudeli authored Dec 20, 2023
1 parent 68359d7 commit 47bbc10
Show file tree
Hide file tree
Showing 59 changed files with 3,403 additions and 2,143 deletions.
3 changes: 1 addition & 2 deletions configs/eslint-config/react-ts-noimport.js → .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ["./react.js", "@fepack/eslint-config-ts/noimport"],
};
}
13 changes: 13 additions & 0 deletions .github/actions/pnpm-setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: setup pnpm & node
description: setup pnpm & node
runs:
using: composite
steps:
- uses: pnpm/action-setup@v2
with:
version: 8.12.0
- uses: actions/setup-node@v4
with:
cache: "pnpm"
cache-dependency-path: "pnpm-lock.yaml"
node-version-file: ".nvmrc"
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
command: ["lint", "lint:pub", "test", "type:check"]
command: ['lint', 'lint:attw', 'lint:monorepo', 'lint:pub', 'test', 'type:check', 'build']
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.6.10
- uses: actions/setup-node@v3
with:
cache: "pnpm"
cache-dependency-path: "pnpm-lock.yaml"
node-version-file: ".nvmrc"
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-setup-node
- run: pnpm install --frozen-lockfile
- if: matrix.command == 'test'
run: pnpm exec playwright install
run: pnpm playwright install
- run: pnpm prepack
- run: pnpm ${{ matrix.command }}
13 changes: 3 additions & 10 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@ jobs:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.6.10
- uses: actions/setup-node@v3
with:
cache: "pnpm"
cache-dependency-path: "pnpm-lock.yaml"
node-version-file: ".nvmrc"
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-setup-node
- run: pnpm install --frozen-lockfile
- run: pnpm exec playwright install
- run: pnpm playwright install
- run: pnpm test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.6.10
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
cache-dependency-path: 'pnpm-lock.yaml'
node-version-file: '.nvmrc'
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-setup-node
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install dependencies
Expand Down
26 changes: 4 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.6.10
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
cache-dependency-path: 'pnpm-lock.yaml'
node-version-file: '.nvmrc'
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-setup-node
- run: pnpm install --frozen-lockfile

- name: Set git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "Chung-il Jung"
- name: Create Changesets Pull Request or Publish to NPM
id: changesets
uses: changesets/action@v1
with:
setupGitUser: false
title: 'chore: version packages'
commit: |
chore: version packages
Co-authored-by: Chung-il Jung <[email protected]>
Co-authored-by: Jonghyeon Ko <[email protected]>
title: "chore: version packages"
commit: "chore: version packages"
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
Expand Down
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": ["packlint", "codecov", "fepack"]
"cSpell.words": ["fepack", "packlint", "codecov", "fepack"]
}
4 changes: 2 additions & 2 deletions configs/eslint-config-js/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ["./javascript.js"],
};
extends: ['./index.js'],
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ["plugin:import/recommended", "./noimport.js"],
extends: ["plugin:import/recommended", "./no-import.js"],
plugins: ["import"],
rules: {
"sort-imports": ["error", { ignoreDeclarationSort: true }],
"import/no-duplicates": "error",
"import/order": [
"warn",
{
Expand All @@ -17,6 +19,5 @@ module.exports = {
alphabetize: { order: "asc", caseInsensitive: true },
},
],
"sort-imports": ["error", { ignoreDeclarationSort: true }],
},
};
42 changes: 42 additions & 0 deletions configs/eslint-config-js/no-import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
env: {
es2020: true,
browser: true,
node: true,
jest: true,
},
parserOptions: {
ecmaVersion: 2020,
},
plugins: ["jsdoc"],
extends: [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:jsdoc/recommended",
"plugin:@cspell/recommended",
],
rules: {
"no-warning-comments": "warn",
"jsdoc/require-description": "warn",
"jsdoc/require-returns": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/check-param-names": "error",
"@cspell/spellchecker": [
"warn",
{
cspell: {
words: ["packlint", "codecov", "tsup"],
},
},
],
},
overrides: [
{
files: ["*.spec.ts*", "*.test.ts*"],
plugins: ["vitest", "jest-dom"],
extends: ["plugin:vitest/recommended"],
},
],
};
25 changes: 0 additions & 25 deletions configs/eslint-config-js/noimport.js

This file was deleted.

20 changes: 10 additions & 10 deletions configs/eslint-config-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"name": "@fepack/eslint-config-js",
"version": "0.0.0",
"private": true,
"main": "javascript.js",
"main": "index.js",
"files": [
"noimport.js"
"no-import.js"
],
"scripts": {
"lint": "eslint ."
},
"devDependencies": {
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vitest": "0.3.1"
},
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
"dependencies": {
"@cspell/eslint-plugin": "^8.1.3",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest-dom": "^5.1.0",
"eslint-plugin-jsdoc": "^46.9.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-vitest": "0.3.17"
}
}
4 changes: 2 additions & 2 deletions configs/eslint-config-ts/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ["@fepack/eslint-config-js"],
};
extends: ['@fepack/eslint-config-js'],
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ["plugin:import/typescript", "./noimport.js"],
extends: ["plugin:import/typescript", "./no-import.js"],
plugins: ["import"],
settings: {
"import/resolver": {
Expand All @@ -16,6 +16,7 @@ module.exports = {
],
rules: {
"sort-imports": ["error", { ignoreDeclarationSort: true }],
"import/no-duplicates": "error",
"import/order": [
"error",
{
Expand Down
34 changes: 34 additions & 0 deletions configs/eslint-config-ts/no-import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["jsdoc", "@typescript-eslint"],
extends: [
"@fepack/eslint-config-js/no-import",

Check warning on line 7 in configs/eslint-config-ts/no-import.js

View workflow job for this annotation

GitHub Actions / Check quality (lint)

Unknown word: "fepack"
"plugin:jsdoc/recommended-typescript",
"plugin:@typescript-eslint/recommended",
],
rules: {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/naming-convention": [
"error",
{
selector: "typeParameter",
format: ["PascalCase"],
leadingUnderscore: "allow",
custom: {
regex: "^(T|\\$)[A-Z][a-zA-Z]+[0-9]*$",
match: true,
},
},
],
"jsdoc/require-description": "warn",
"jsdoc/require-returns": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/check-param-names": "error",
"jsdoc/check-tag-names": "off",
"jsdoc/no-types": "off",
},
};
19 changes: 0 additions & 19 deletions configs/eslint-config-ts/noimport.js

This file was deleted.

20 changes: 10 additions & 10 deletions configs/eslint-config-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
"name": "@fepack/eslint-config-ts",
"version": "0.0.0",
"private": true,
"main": "typescript.js",
"main": "index.js",
"files": [
"./noimport.js"
"./no-import.js"
],
"scripts": {
"lint": "eslint ."
},
"devDependencies": {
"dependencies": {
"@fepack/eslint-config-js": "workspace:*",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-jsdoc": "^46.8.2"
},
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^46.9.1",
"eslint-plugin-prettier": "^5.0.1"
}
}
4 changes: 2 additions & 2 deletions configs/eslint-config/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ["@fepack/eslint-config-js"],
};
extends: ['@fepack/eslint-config-js'],
}
Loading

0 comments on commit 47bbc10

Please sign in to comment.