-
Notifications
You must be signed in to change notification settings - Fork 9
Standardize eslint and prettier for the entire project with ci checks #110
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0a0dd1f
Added prettier configuration
matux f777c28
Fix eslint+babel config, add eslint ignore
matux 843be6c
New CI with updated action versions, cache and linters
matux 53c061c
Disable lint for this PR, to be enabled post-lint fixes and formatting
matux 9c2f5c5
Bumped node version in publish ci from 12 to 14
matux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| .github | ||
| .next | ||
| build | ||
| bundles | ||
| coverage | ||
| dist | ||
| lib | ||
| node_modules | ||
| out | ||
| public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,57 @@ | ||
| name: rollbar-react CI | ||
| name: ci | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ '**' ] | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: [ main ] | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [14.x] | ||
| node: [14, 16, 18, 20] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - run: npm install | ||
| - run: npm run lint | ||
| - run: npm run test | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up node ${{ matrix.node }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
|
|
||
| - name: Cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-node-${{ matrix.node }}- | ||
| ${{ runner.os }}-node- | ||
| ${{ runner.os }}- | ||
|
|
||
| - name: Install library dependencies | ||
| run: npm ci | ||
| - name: Install examples/create-react-app dependencies | ||
| run: cd examples/create-react-app && npm ci | ||
| - name: Install examples/nextjs dependencies | ||
| run: cd examples/nextjs && npm ci | ||
| - name: Install examples/typescript dependencies | ||
| run: cd examples/typescript && npm ci | ||
|
|
||
| - name: Lint | ||
| uses: wearerequired/lint-action@v2 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| prettier: false | ||
| eslint: false | ||
| eslint_args: '--max-warnings 0' | ||
| eslint_extensions: js,jsx,ts,tsx | ||
|
|
||
| - name: Test | ||
| run: npm run test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| .github | ||
| .next | ||
| build | ||
| bundles | ||
| coverage | ||
| dist | ||
| lib | ||
| node_modules | ||
| out | ||
| public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "[github-actions-workflow]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true | ||
| }, | ||
| "[javascript]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true | ||
| }, | ||
| "[javascriptreact]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true | ||
| }, | ||
| "[json5]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true | ||
| }, | ||
| "[jsonc]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true | ||
| }, | ||
| "[typescript]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true | ||
| }, | ||
| "[typescriptreact]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true | ||
| }, | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true, | ||
| "editor.formatOnSaveMode": "file", | ||
| "editor.tabSize": 2, | ||
| "editor.codeActionsOnSave": { | ||
| "source.fixAll.eslint": "explicit" | ||
| }, | ||
| "files.trimTrailingWhitespace": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** @type {import('eslint').Linter.Config} */ | ||
| module.exports = { | ||
| root: true, | ||
| extends: 'next/core-web-vitals', | ||
| ignorePatterns: ['node_modules'], | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ | |
| "lint": "eslint src" | ||
| }, | ||
| "eslintConfig": { | ||
| "root": true, | ||
| "extends": [ | ||
| "react-app", | ||
| "react-app/jest" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /** @type {import('prettier').Config} */ | ||
| module.exports = { | ||
| trailingComma: 'es5', | ||
| bracketSpacing: true, | ||
| tabWidth: 2, | ||
| semi: false, | ||
| singleQuote: true, | ||
| arrowParens: 'always', | ||
| }; | ||
|
mudetroit marked this conversation as resolved.
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.