Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ESLint its own separate job on CI. #21

Merged
merged 36 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
459b759
Use the ESlint repo instead.
dipack95 Mar 14, 2024
0574bda
Testing stuff.
dipack95 Mar 14, 2024
e4a28dc
Remove the FIXME.
dipack95 Mar 14, 2024
394eec7
Try using the new base.
dipack95 Mar 14, 2024
7c1b9cb
Remove bad comment.
dipack95 Mar 14, 2024
ce4bb83
Exclude itself.
dipack95 Mar 14, 2024
0cd3a32
Test.
dipack95 Mar 14, 2024
2619d6e
Remove itself?
dipack95 Mar 14, 2024
ae5b3b4
Harder test.
dipack95 Mar 14, 2024
07ab4d1
[ci:run]
dipack95 Mar 14, 2024
491daf8
Run eslint all the time.
dipack95 Mar 14, 2024
324bde7
Modify log.
dipack95 Mar 14, 2024
e083f97
Use a newer version.
dipack95 Mar 14, 2024
60fc12e
Log.
dipack95 Mar 14, 2024
54ab038
Do lots of things.
dipack95 Mar 14, 2024
312a85a
Use the exec.
dipack95 Mar 14, 2024
2763d71
Log.
dipack95 Mar 14, 2024
cf973b5
Entry?
dipack95 Mar 14, 2024
e67957e
Run over all files.
dipack95 Mar 14, 2024
277dfeb
Go back.
dipack95 Mar 14, 2024
ace445e
Skip yarn folder.
dipack95 Mar 14, 2024
81afd2b
Exclude more files
dipack95 Mar 14, 2024
f21426a
Bring back entry.
dipack95 Mar 14, 2024
b937527
Use new deps.
dipack95 Mar 14, 2024
cf802fc
Bump.
dipack95 Mar 14, 2024
2a87218
Make a separate pre-commit action.
dipack95 Mar 14, 2024
ed77213
Format based off of what prettier wants.
dipack95 Mar 14, 2024
b0096dc
DO not use a cache strat.
dipack95 Mar 14, 2024
b3ce1b9
Bump.
dipack95 Mar 14, 2024
eb92d9f
Remove the bad stuff.
dipack95 Mar 14, 2024
99d7bd7
Use only local stuff.
dipack95 Mar 14, 2024
3ab4c22
Immutable.
dipack95 Mar 14, 2024
ed9ef3a
Exclude PNP file.
dipack95 Mar 14, 2024
ebaae95
Test.
dipack95 Mar 14, 2024
e313f66
Remove and add comment.
dipack95 Mar 14, 2024
9901395
Bump version.
dipack95 Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,34 @@ jobs:
with:
node-version: 20.x
- run: yarn
- uses: pre-commit/[email protected]
- name: pre-commit
env:
SKIP: eslint
run: |
python -m pip install pre-commit && \
python -m pip freeze --local && \
pre-commit run \
--show-diff-on-failure \
--color=always \
--source ${{ github.event.pull_request.base.sha || 'HEAD~1' }} \
--origin ${{ github.event.pull_request.head.sha || 'HEAD' }} ;

run-eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
extra_args: --source ${{ github.event.pull_request.base.sha || 'HEAD~1' }} --origin ${{ github.event.pull_request.head.sha || 'HEAD' }}
fetch-depth: 100 # need the history to do a changed files check below (source, origin)
- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 20.x
- run: yarn install --immutable

# The exclusion from the `git diff` is necessary because `yarn install`
# on CI modifies the `.pnp.cjs` file to change their actual locations
# but we don't care about that on CI.
- run: yarn lint --quiet --fix && git diff --exit-code -- . ':(exclude)*.pnp.cjs'

build-to-npm:
if: github.ref == 'refs/heads/main'
Expand All @@ -68,6 +93,7 @@ jobs:
- run-depcheck
- build-and-upload-artifacts
- run-pre-commits
- run-eslint
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -90,6 +116,7 @@ jobs:
- run-depcheck
- build-and-upload-artifacts
- run-pre-commits
- run-eslint
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
- repo: https://github.com/pre-commit/mirrors-prettier
# Use the sha / tag you want to point at, this needs
# to stay in sync with the package.json version
rev: 'v2.7.1'
rev: 'v3.0.3'
hooks:
- id: prettier
args: [--write, --list-different]
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Transcend Inc.",
"name": "@transcend-io/type-utils",
"description": "Small package containing useful typescript utilities.",
"version": "1.4.0",
"version": "1.4.1",
"homepage": "https://github.com/transcend-io/type-utils",
"repository": {
"type": "git",
Expand All @@ -19,7 +19,7 @@
"update:deps": "yarn upgrade-interactive && yarn update:sdks",
"build": "yarn tsc --build",
"clean": "yarn tsc --build --clean",
"lint": "yarn eslint src --ext .ts",
"lint": "yarn eslint ./src --ext .js --ext .ts --ext .tsx --ext .jsx",
"prepublish": "yarn build",
"test": "yarn mocha './src/**/*.test.ts'"
},
Expand Down
6 changes: 2 additions & 4 deletions src/codecTools/dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import { unsafeCoerce } from 'fp-ts/lib/function';
import * as t from 'io-ts';

/** A record with optional keys */
export interface DictionaryC<
D extends t.Mixed,
C extends t.Mixed,
> extends t.DictionaryType<
export interface DictionaryC<D extends t.Mixed, C extends t.Mixed>
extends t.DictionaryType<
D,
C,
{
Expand Down
6 changes: 2 additions & 4 deletions src/codecTools/partialRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
import * as t from 'io-ts';

// TODO: https://github.com/gcanti/io-ts/issues/429 - remove if/when io-ts supports this natively
export interface PartialRecordC<
D extends t.Mixed,
C extends t.Mixed,
> extends t.DictionaryType<
export interface PartialRecordC<D extends t.Mixed, C extends t.Mixed>
extends t.DictionaryType<
D,
C,
{
Expand Down
2 changes: 1 addition & 1 deletion src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export const HttpMethod = makeEnum({
/**
* Override to cast as string
*/
export type HttpMethod = typeof HttpMethod[keyof typeof HttpMethod];
export type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
Loading