Skip to content

Commit

Permalink
feat: add eslint-config-bases package, remove eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Feb 7, 2023
1 parent 8944388 commit 417190b
Show file tree
Hide file tree
Showing 126 changed files with 6,585 additions and 3,408 deletions.
32 changes: 18 additions & 14 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "wayofdev/npm-shareable-configs"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "wayofdev/npm-shareable-configs"
}
],
"privatePackages": {
"version": true,
"tag": true
},
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
68 changes: 68 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
# @link https://docs.codeclimate.com/docs/default-analysis-configuration#sample-codeclimateyml

version: '2'

checks:
argument-count:
enabled: true
config:
threshold: 4
complex-logic:
enabled: true
config:
threshold: 4
file-lines:
enabled: true
config:
threshold: 300
method-complexity:
enabled: true
config:
threshold: 5
method-count:
enabled: true
config:
threshold: 20
method-lines:
enabled: true
config:
threshold: 300
nested-control-flow:
enabled: true
config:
threshold: 4
return-statements:
enabled: true
config:
threshold: 4
similar-code:
enabled: false
config:
threshold: 5
identical-code:
enabled: false
config:
threshold: 5

# plugins:
# eslint:
# enabled: true
# channel: "eslint-7"

exclude_patterns:
- 'docs/'
- '**/node_modules/'
- '**/config/'
- '**/*.config.js'
- '**/dist/'
- '**/scripts/'
- '**/__tests__/'
- '**/*.test.js'
- '**/*.test.jsx'
- '**/*.test.ts'
- '**/*.test.tsx'
- '**/*.d.ts'
- '**/*.seed.ts'
- '**/seed.ts'
- '**/.mesh/'
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# editorconfig.org
# https://github.com/twbs/bootstrap/blob/main/.editorconfig

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_size = 2
trim_trailing_whitespace = true

[*.md]
Expand Down
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: './packages/eslint-config',
};
extends: './packages/eslint-config-bases',
}
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto

/.github export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
CHANGELOG.md export-ignore
40 changes: 40 additions & 0 deletions .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: 'Monorepo install (pnpm)'
description: 'Run pnpm install'

runs:
using: 'composite'

steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false

- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
id: pnpm-config
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache rotation keys
id: cache-rotation
shell: bash
run: |
echo "YEAR_WEEK=$(/bin/date -u "+%Y%W")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
id: pnpm-store-cache
with:
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_WEEK }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_WEEK }}-
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile --strict-peer-dependencies --prefer-offline
env:
HUSKY: '0'
27 changes: 0 additions & 27 deletions .github/dependabot.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/auto-merge.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/auto-rebase.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/ci-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: CI for Packages

on: # yamllint disable-line rule:truthy
push:
branches:
- master
- develop
# Only consider those paths to trigger the action
paths:
- 'packages/**'
- 'package.json'
- 'pnpm*'
- '.github/**'

pull_request:
types:
- opened
- synchronize
- reopened
# Only consider those paths to trigger the action
paths:
- 'packages/**'
- 'package.json'
- 'pnpm*'
- '.github/**'

jobs:
integration:
name: Node ${{ matrix.node }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ['ubuntu-22.04']
node: ['18']

steps:
- name: Check out the codebase
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org/'

- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Restore packages cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/pnpm*.yaml') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }}
restore-keys: |
${{ runner.os }}-packages-cache-${{ hashFiles('**/pnpm*.yaml') }}-
- if: github.event_name == 'pull_request'
name: Validate all commits from PR
uses: wagoid/commitlint-github-action@v5
env:
NODE_PATH: ${{ github.workspace }}/node_modules

# Lint packages that have changed (--include & --since)
- name: Linter
run: |
pnpm --filter "...[origin/master]" run lint
Loading

0 comments on commit 417190b

Please sign in to comment.