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

add windows and mac support #15

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
10 changes: 9 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,13 @@ module.exports = {
'prettier',
'prettier/@typescript-eslint',
'plugin:prettier/recommended'
]
],
rules: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want this here. This prettier/prettier ESLint plugin is reading the settings from the prettier.config.js file, so any formatting-config changes we'd make should go in prettier.config.js

I'm guessing that if you ran into an issue with this, instead of swapping the default value for endOfLine, we should set up a pre-commit hook to run prettier with the project's configuration (or make sure that your local editor is set up to run prettier itself).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that Windows uses CRLF, and by default Prettier enforces LF only. So the build fails on Windows because of this limitation. I can move the rule to prettier.config.js, but the rule is still needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brimtown When I add a Prettier config file, it looks line the ESLint config file starts to be ignored. From the information I found online, I think when both Prettier and ESLint are combined then any Prettier configuration should be done in the ESLint configuration. Please let me know if you know of a way to use both.

'prettier/prettier': [
'error',
{
'endOfLine': 'auto'
}
]
}
};
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ on: pull_request
jobs:
test-and-lint:
name: Run tests and lint
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [12, 14, 16]

steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: ${{ matrix.node }}
- run: yarn install
- run: yarn lint
- run: yarn typecheck
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"access": "public"
},
"scripts": {
"build": "yarn clean; tsc -p tsconfig.build.json",
"build": "yarn clean && tsc -p tsconfig.build.json",
"clean": "rm -rf dist/*",
"test": "jest",
"lint": "eslint \"src/**/*.{js,ts}\"",
Expand Down