-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate ESLint config & Add CI (#10)
* Migrate ESLint config * Add CI and fix links in readme * lint
- Loading branch information
Showing
16 changed files
with
2,506 additions
and
803 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,39 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build-and-test: | ||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
|
||
name: Build & test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Type checking | ||
run: yarn run check-types | ||
|
||
- name: Build Next.js | ||
run: yarn run build | ||
env: | ||
CI: true | ||
|
||
- name: Lint | ||
run: yarn lint |
This file contains 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 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"bradlc.vscode-tailwindcss", | ||
"yoavbls.pretty-ts-errors", | ||
"ms-playwright.playwright", | ||
"github.vscode-github-actions", | ||
"rvest.vs-code-prettier-eslint" | ||
] | ||
} |
This file contains 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,34 @@ | ||
{ | ||
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.addMissingImports": "explicit", | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" | ||
}, | ||
"eslint.nodePath": "./node_modules/eslint", | ||
|
||
"eslint.format.enable": true, | ||
"eslint.validate": [ | ||
"javascript", | ||
"typescript", | ||
"javascriptreact", | ||
"typescriptreact", | ||
"html", | ||
"markdown", | ||
"json", | ||
"yaml", | ||
"css", | ||
"pcss", | ||
"postcss", | ||
"github-actions-workflow" | ||
], | ||
"search.exclude": { | ||
"yarn.lock": true | ||
} | ||
} |
This file contains 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 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 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,60 @@ | ||
import antfu from '@antfu/eslint-config'; | ||
import nextPlugin from '@next/eslint-plugin-next'; | ||
import jestDom from 'eslint-plugin-jest-dom'; | ||
import jsxA11y from 'eslint-plugin-jsx-a11y'; | ||
import playwright from 'eslint-plugin-playwright'; | ||
import tailwind from 'eslint-plugin-tailwindcss'; | ||
import testingLibrary from 'eslint-plugin-testing-library'; | ||
|
||
export default antfu({ | ||
react: true, | ||
typescript: true, | ||
|
||
lessOpinionated: true, | ||
isInEditor: false, | ||
|
||
stylistic: { | ||
semi: true, | ||
}, | ||
|
||
formatters: { | ||
css: true, | ||
}, | ||
|
||
ignores: [ | ||
'migrations/**/*', | ||
'next-env.d.ts', | ||
'node_modules/**/*', | ||
'public/**/*', | ||
], | ||
}, ...tailwind.configs['flat/recommended'], jsxA11y.flatConfigs.recommended, { | ||
plugins: { | ||
'@next/next': nextPlugin, | ||
}, | ||
rules: { | ||
...nextPlugin.configs.recommended.rules, | ||
...nextPlugin.configs['core-web-vitals'].rules, | ||
}, | ||
}, { | ||
files: [ | ||
'**/*.test.ts?(x)', | ||
], | ||
...testingLibrary.configs['flat/react'], | ||
...jestDom.configs['flat/recommended'], | ||
}, { | ||
files: [ | ||
'**/*.spec.ts', | ||
'**/*.e2e.ts', | ||
], | ||
...playwright.configs['flat/recommended'], | ||
}, { | ||
rules: { | ||
'antfu/no-top-level-await': 'off', // Allow top-level await | ||
'style/brace-style': ['error', '1tbs'], // Use the default brace style | ||
'ts/consistent-type-definitions': ['error', 'type'], // Use `type` instead of `interface` | ||
'react/prefer-destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable | ||
'node/prefer-global/process': 'off', // Allow using `process.env` | ||
'test/padding-around-all': 'error', // Add padding in test files | ||
'test/prefer-lowercase-title': 'off', // Allow using uppercase titles in test titles | ||
}, | ||
}); |
This file contains 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 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 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,3 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@tailwind utilities; |
This file contains 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 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,4 +1,3 @@ | ||
|
||
export default function Home() { | ||
return ( | ||
<div className=""> | ||
|
Oops, something went wrong.