Skip to content

Commit

Permalink
Merge pull request #20 from abxvn/feat/pnpm
Browse files Browse the repository at this point in the history
feat: pnpm
  • Loading branch information
hungluu authored Dec 27, 2023
2 parents 3cc619d + 743942a commit 4aff343
Show file tree
Hide file tree
Showing 129 changed files with 9,749 additions and 11,228 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Expand Down
110 changes: 49 additions & 61 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,54 @@
module.exports = {
extends: [
'eslint:recommended',
'standard'
// for react only
// "standard-jsx"
'standard',
// 'standard-jsx', // for react only
],
env: {
es6: true
es6: true,
},
parserOptions: {
ecmaVersion: 8,
ecmaFeatures: {
experimentalObjectRestSpread: true
}
experimentalObjectRestSpread: true,
},
},
ignorePatterns: [
'node_modules',
'.yarn',
'**/index.js',
'**/index.d.ts'
'**/*.d.ts',
'**/*.mjs',
'**/node_modules',
'**/*.spec.ts',
'**/*.test.ts',
],
rules: {
'no-unused-vars': 'warn',
'no-var': 'error',
'consistent-return': 'warn',
complexity: [
'warn',
{
max: 20
}
],
'consistent-return': 'off',
complexity: ['warn', { max: 15 }],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: 'let',
next: '*'
},
{
blankLine: 'any',
prev: 'let',
next: 'let'
},
{
blankLine: 'any',
prev: 'let',
next: 'const'
},
{
blankLine: 'always',
prev: 'const',
next: '*'
},
{
blankLine: 'any',
prev: 'const',
next: 'const'
},
{
blankLine: 'any',
prev: 'const',
next: 'let'
},
{
blankLine: 'always',
prev: '*',
next: 'return'
}
{ blankLine: 'always', prev: 'let', next: '*' },
{ blankLine: 'any', prev: 'let', next: 'let' },
{ blankLine: 'any', prev: 'let', next: 'const' },
{ blankLine: 'always', prev: 'const', next: '*' },
{ blankLine: 'any', prev: 'const', next: 'const' },
{ blankLine: 'any', prev: 'const', next: 'let' },
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'any', prev: 'let', next: 'if' },
{ blankLine: 'any', prev: 'const', next: 'if' },
],
'react/prop-types': 'off' // Disable prop-types as we use TypeScript for type checking
semi: ['error', 'never'],
'react/prop-types': 'off', // Disable prop-types as we use TypeScript for type checking
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
}],
},
overrides: [
{
Expand All @@ -79,35 +59,43 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'standard',
// for react only
// "standard-jsx",
'standard-with-typescript'
// 'standard-jsx',
'standard-with-typescript',
],
env: {
browser: true,
es6: true
es6: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: require.resolve('./tsconfig.json'),
ecmaVersion: 8,
ecmaFeatures: {
experimentalObjectRestSpread: true
}
experimentalObjectRestSpread: true,
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off'
}
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
}],
'@typescript-eslint/no-confusing-void-expression': 'off',
},
},
// for jest only
{
files: '*.{spec,test}.{ts,tsx,js}',
extends: [
'plugin:jest/recommended',
'plugin:jest/style'
]
}
]
'plugin:jest/style',
],
},
],
}
13 changes: 9 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ jobs:
run: sudo apt update
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache: 'pnpm'
- name: Install packages
run: |
yarn install
pnpm install
- name: Lint
run: |
yarn lint
pnpm lint
- name: Test
run: |
yarn test
pnpm test
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ dist
.tern-port

# Yarn
.yarnrc
# .yarnrc
# .yarnrc.*
.yarn/*
!.yarn/releases
!.yarn/patches
Expand All @@ -119,13 +120,15 @@ dist
**/*.cache
**/.env
**/index.js
!packages/builder/src/lib/dts/index.js
!packages/builder/src/lib/paths/index.js
!packages/builder/src/plugins/DtsPlugin/index.js

tmp/
**/tmp

**/index.css
**/index.min.css
**/preflight.css
**/preflight.min.css
**/preview.css
**/preview.min.css

## only for this repo
!packages/resolve/tests/mocks/**/index.js
*.node
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig"
// optional
"eamodio.gitlens",
]
}
6 changes: 1 addition & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@
"source.fixAll.eslint": true
},
"eslint.format.enable": true,
"editor.formatOnSave": true,
// remove 3 lines if not using yarn sdks
"eslint.nodePath": ".yarn/sdks",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
"editor.formatOnSave": false,
}
873 changes: 0 additions & 873 deletions .yarn/releases/yarn-berry.cjs

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/eslint/bin/eslint.js

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/eslint/lib/api.js

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/sdks/eslint/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions .yarn/sdks/integrations.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/typescript/bin/tsc

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/typescript/bin/tsserver

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/typescript/lib/tsc.js

This file was deleted.

Loading

0 comments on commit 4aff343

Please sign in to comment.