-
Notifications
You must be signed in to change notification settings - Fork 176
chore: configure biome linter #616
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
Changes from 7 commits
4da249a
b36196d
0d8974b
2938f64
32d08db
2c7127e
80872ba
f1ed15d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
tab_width = 2 | ||
insert_final_newline = true | ||
end_of_line = lf |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
b36196d4ff17934ed71b0926effa20a5a6c1433d |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
name: Lint codebase | ||
description: Run eslint to lint codebase and ensure code quality | ||
description: Run biome to lint codebase and ensure code quality | ||
|
||
runs: | ||
using: 'composite' | ||
using: "composite" | ||
steps: | ||
- name: Install dependencies | ||
run: pnpm install | ||
shell: bash | ||
|
||
- name: Run eslint | ||
run: pnpm lint | ||
- name: Setup Biome CLI | ||
uses: biomejs/[email protected] | ||
|
||
- name: Run biome | ||
run: biome ci --reporter=github | ||
shell: bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["biomejs.biome"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json", | ||
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }, | ||
"files": { | ||
"ignoreUnknown": true | ||
}, | ||
"organizeImports": { "enabled": true }, | ||
"formatter": { "enabled": true, "useEditorconfig": true }, | ||
"css": { "formatter": { "quoteStyle": "single" } }, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"a11y": { | ||
"all": false | ||
}, | ||
"suspicious": { | ||
"noExplicitAny": "info", | ||
"noGlobalIsNan": "warn", | ||
"noImplicitAnyLet": "warn", | ||
"noAssignInExpressions": "warn", | ||
"noConfusingVoidType": "warn", | ||
"useNamespaceKeyword": "warn" // safe fix | ||
}, | ||
"style": { | ||
"noUnusedTemplateLiteral": "warn", | ||
"noInferrableTypes": "warn", // safe fix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you apply these safe fixes ? If so no need to set them as warn, we want to avoid them as much as possible so an error is fine There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've only applied the fixes that were causing formatting or import order errors, which I forgot to mention. Now, running |
||
"noUselessElse": "warn", | ||
"useNodejsImportProtocol": "warn", | ||
"useTemplate": "warn", | ||
"useNumberNamespace": "warn", // safe fix | ||
"noNonNullAssertion": "warn", | ||
"useImportType": "warn", | ||
"noParameterAssign": "warn", | ||
"useDefaultParameterLast": "warn", | ||
"noCommaOperator": "warn", | ||
"useConst": "warn", | ||
"useSingleVarDeclarator": "warn", | ||
"noVar": "warn", | ||
"useShorthandFunctionType": "warn" // safe fix | ||
}, | ||
"correctness": { | ||
"noSwitchDeclarations": "warn", | ||
"noUnnecessaryContinue": "warn", | ||
"noInnerDeclarations": "warn" | ||
}, | ||
"complexity": { | ||
"useLiteralKeys": "warn", | ||
"noForEach": "off", | ||
"noUselessSwitchCase": "warn", | ||
"noUselessConstructor": "warn", | ||
"noBannedTypes": "warn", | ||
"noUselessTernary": "warn", | ||
"useArrowFunction": "warn", // safe fix | ||
"noExtraBooleanCast": "warn", | ||
"useOptionalChain": "warn" | ||
}, | ||
"performance": { | ||
"noDelete": "warn", | ||
"noAccumulatingSpread": "warn" | ||
} | ||
} | ||
}, | ||
"overrides": [ | ||
{ | ||
"include": ["packages/tests-unit/**", "packages/tests-e2e/**"], | ||
"linter": { | ||
"rules": { | ||
"suspicious": { | ||
"noRedeclare": "warn" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"include": ["examples/**/*"], | ||
"linter": { | ||
"rules": { | ||
"style": { | ||
"useSelfClosingElements": "warn" | ||
}, | ||
"correctness": { | ||
"useJsxKeyInIterable": "warn", | ||
"useExhaustiveDependencies": "warn" | ||
}, | ||
"suspicious": { | ||
"noArrayIndexKey": "warn", | ||
"noRedeclare": "warn" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
{ | ||
"songs": [ | ||
{ | ||
"rank": 1, | ||
"title": "I'm never gonna give you up", | ||
"artist": "Rick Astley", | ||
"album": "Hold Me In Your Arms", | ||
"year": "1965", | ||
"videoId": "dQw4w9WgXcQ" | ||
}, | ||
{ | ||
"rank": 2, | ||
"title": "My Wang", | ||
"artist": "Frank Wangnatra", | ||
"album": "@franjiewang", | ||
"year": "2023", | ||
"videoId": "qQzdAsjWGPg" | ||
}, | ||
{ | ||
"rank": 3, | ||
"title": "Excuse me miSST", | ||
"artist": "Jay-Air", | ||
"album": "@Jayair", | ||
"year": "2023", | ||
"videoId": "tnDh0JhmaFw" | ||
}, | ||
{ | ||
"rank": 4, | ||
"title": "I don't want another CONSOLE-RRY", | ||
"artist": "Dax", | ||
"album": "@thxdr", | ||
"year": "2023", | ||
"videoId": "4JI70_9acgE" | ||
} | ||
{ | ||
"rank": 1, | ||
"title": "I'm never gonna give you up", | ||
"artist": "Rick Astley", | ||
"album": "Hold Me In Your Arms", | ||
"year": "1965", | ||
"videoId": "dQw4w9WgXcQ" | ||
}, | ||
{ | ||
"rank": 2, | ||
"title": "My Wang", | ||
"artist": "Frank Wangnatra", | ||
"album": "@franjiewang", | ||
"year": "2023", | ||
"videoId": "qQzdAsjWGPg" | ||
}, | ||
{ | ||
"rank": 3, | ||
"title": "Excuse me miSST", | ||
"artist": "Jay-Air", | ||
"album": "@Jayair", | ||
"year": "2023", | ||
"videoId": "tnDh0JhmaFw" | ||
}, | ||
{ | ||
"rank": 4, | ||
"title": "I don't want another CONSOLE-RRY", | ||
"artist": "Dax", | ||
"album": "@thxdr", | ||
"year": "2023", | ||
"videoId": "4JI70_9acgE" | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
"@types/react": "npm:[email protected]", | ||
"@types/react-dom": "npm:[email protected]" | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.