-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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 Biome.js for local linting #5587
Draft
sidharthv96
wants to merge
19
commits into
develop
Choose a base branch
from
sidv/biome
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,345
−474
Draft
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2c80d80
feat: Add biome
sidharthv96 08dfdfe
chore: Biome auto fixes
sidharthv96 3381717
chore: Biome fix for-of loops
sidharthv96 22a00a5
chore: Update lint scripts
sidharthv96 98f32bf
chore: Remove unused deps
sidharthv96 0a5315c
chore: Add biome renovate config
sidharthv96 3a5793f
chore: Enable eslint in CI
sidharthv96 a23b891
chore: Add .eslintignore
sidharthv96 ba34386
Fix prettier formatting on generation.
sidharthv96 d2b42eb
chore: Add eslint-disable
sidharthv96 e7577ed
chore: Add eslint-disable
sidharthv96 55a8e4c
chore: remove comments in json
sidharthv96 a1badd5
chore: Fix shape names
sidharthv96 89e061a
chore: Fix gantt test
sidharthv96 054ed6c
Merge branch 'develop' into sidv/biome
sidharthv96 48303a0
Format on pre-commit
sidharthv96 422b8cd
chore: Add `eslint-config-biome`
sidharthv96 8cbe3e0
chore: Remove redundant eslint comments
sidharthv96 94fa235
Merge branch 'develop' into sidv/biome
sidharthv96 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 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
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,10 +1,6 @@ | ||
export default { | ||
'!(docs/**/*)*.{ts,js,html,md,mts}': [ | ||
'eslint --cache --cache-strategy content --fix', | ||
// don't cache prettier yet, since we use `prettier-plugin-jsdoc`, | ||
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. We can probably remove |
||
// and prettier doesn't invalidate cache on plugin updates" | ||
// https://prettier.io/docs/en/cli.html#--cache | ||
'prettier --write', | ||
'biome check --no-errors-on-unmatched --files-ignore-unknown=true --write', | ||
], | ||
'.cspell/*.txt': ['tsx scripts/fixCSpell.ts'], | ||
'**/*.jison': ['pnpm -w run lint:jison'], | ||
|
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
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,229 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json", | ||
"files": { | ||
"ignore": [ | ||
"**/contributor-names.json", | ||
"**/generated/", | ||
"**/knsv*.html", | ||
"**/local*.html", | ||
"**/stats/", | ||
"**/user-avatars/*", | ||
"./.vscode/**", | ||
"cypress/platform/current.html", | ||
"cypress/platform/experimental.html", | ||
"cypress/platform/xss3.html", | ||
"cypress/screenshots/", | ||
"cypress/snapshots/", | ||
"demos/dev/**", | ||
"packages/mermaid/src/config.type.ts" | ||
] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": false, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineEnding": "lf", | ||
"lineWidth": 100, | ||
"attributePosition": "auto" | ||
}, | ||
"organizeImports": { "enabled": false }, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": false, | ||
"complexity": { | ||
"noBannedTypes": "error", | ||
"noExtraBooleanCast": "error", | ||
"noMultipleSpacesInRegularExpressionLiterals": "error", | ||
"noUselessCatch": "error", | ||
"noUselessThisAlias": "error", | ||
"noUselessTypeConstraint": "error", | ||
"noWith": "error", | ||
"useFlatMap": "error" | ||
}, | ||
"correctness": { | ||
"noConstAssign": "error", | ||
"noConstantCondition": "error", | ||
"noEmptyCharacterClassInRegex": "error", | ||
"noEmptyPattern": "error", | ||
"noGlobalObjectCalls": "error", | ||
"noInnerDeclarations": "error", | ||
"noInvalidConstructorSuper": "error", | ||
"noNewSymbol": "error", | ||
"noNonoctalDecimalEscape": "error", | ||
"noPrecisionLoss": "error", | ||
"noSelfAssign": "error", | ||
"noSetterReturn": "error", | ||
"noSwitchDeclarations": "error", | ||
"noUndeclaredVariables": "error", | ||
"noUnreachable": "error", | ||
"noUnreachableSuper": "error", | ||
"noUnsafeFinally": "error", | ||
"noUnsafeOptionalChaining": "error", | ||
"noUnusedLabels": "error", | ||
"noUnusedVariables": "off", | ||
"useArrayLiterals": "off", | ||
"useIsNan": "error", | ||
"useValidForDirection": "error", | ||
"useYield": "error" | ||
}, | ||
"style": { | ||
"noNamespace": "error", | ||
"useAsConstAssertion": "error", | ||
"useBlockStatements": "error", | ||
"useForOf": "error", | ||
"useImportType": "error", | ||
"useNamingConvention": { | ||
"level": "off", | ||
"options": { "strictCase": false } | ||
} | ||
}, | ||
"suspicious": { | ||
"noAssignInExpressions": "warn", | ||
"noAsyncPromiseExecutor": "error", | ||
"noCatchAssign": "error", | ||
"noClassAssign": "error", | ||
"noCompareNegZero": "error", | ||
"noConsoleLog": "off", | ||
"noControlCharactersInRegex": "error", | ||
"noDebugger": "error", | ||
"noDuplicateCase": "error", | ||
"noDuplicateClassMembers": "error", | ||
"noDuplicateObjectKeys": "error", | ||
"noDuplicateParameters": "error", | ||
"noEmptyBlockStatements": "off", | ||
"noExplicitAny": "off", | ||
"noExtraNonNullAssertion": "error", | ||
"noFallthroughSwitchClause": "error", | ||
"noFunctionAssign": "error", | ||
"noGlobalAssign": "error", | ||
"noImportAssign": "error", | ||
"noMisleadingCharacterClass": "error", | ||
"noMisleadingInstantiator": "error", | ||
"noPrototypeBuiltins": "off", | ||
"noRedeclare": "error", | ||
"noShadowRestrictedNames": "error", | ||
"noUnsafeDeclarationMerging": "error", | ||
"noUnsafeNegation": "error", | ||
"useGetterReturn": "error", | ||
"useIsArray": "error", | ||
"useValidTypeof": "error" | ||
} | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"jsxQuoteStyle": "double", | ||
"quoteProperties": "asNeeded", | ||
"trailingCommas": "es5", | ||
"semicolons": "always", | ||
"arrowParentheses": "always", | ||
"bracketSpacing": true, | ||
"bracketSameLine": false, | ||
"quoteStyle": "single", | ||
"attributePosition": "auto" | ||
}, | ||
"globals": [ | ||
"it", | ||
"describe", | ||
"beforeEach", | ||
"beforeAll", | ||
"afterEach", | ||
"cy", | ||
"expect", | ||
"context", | ||
"Cypress" | ||
] | ||
}, | ||
"overrides": [ | ||
{ | ||
"include": ["cypress/**", "demos/**", "**/scripts"], | ||
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } } | ||
}, | ||
{ "include": ["*.{js,jsx,mjs,cjs}"], "linter": { "rules": {} } }, | ||
{ "include": ["*.{ts,tsx}"], "linter": { "rules": {} } }, | ||
{ | ||
"include": ["*.spec.{ts,js}", "cypress/**", "demos/**", "**/docs/**"], | ||
"linter": { | ||
"rules": { | ||
"correctness": { "noUnusedVariables": "off" }, | ||
"style": { | ||
"useNamingConvention": "off" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"include": ["*.spec.{ts,js}", "tests/**", "cypress/**/*.js"], | ||
"linter": { | ||
"rules": { | ||
"style": { | ||
"useNamingConvention": "off" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"include": ["*.html", "*.md", "**/*.md/*"], | ||
"linter": { | ||
"rules": { | ||
"correctness": { | ||
"noUndeclaredVariables": "off", | ||
"noUnusedVariables": "off" | ||
}, | ||
"style": { "noVar": "error" } | ||
} | ||
} | ||
}, | ||
{ "include": ["*.md"] }, | ||
{ | ||
"include": ["**/*.md/**"], | ||
"linter": { | ||
"rules": { | ||
"correctness": { | ||
"noUndeclaredVariables": "off", | ||
"noUnusedVariables": "off" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"], | ||
"linter": { | ||
"rules": { | ||
"correctness": { | ||
"noConstAssign": "off", | ||
"noGlobalObjectCalls": "off", | ||
"noInvalidConstructorSuper": "off", | ||
"noNewSymbol": "off", | ||
"noSetterReturn": "off", | ||
"noUndeclaredVariables": "off", | ||
"noUnreachable": "off", | ||
"noUnreachableSuper": "off" | ||
}, | ||
"style": { | ||
"noArguments": "error", | ||
"noVar": "error", | ||
"useConst": "error" | ||
}, | ||
"suspicious": { | ||
"noDuplicateClassMembers": "off", | ||
"noDuplicateObjectKeys": "off", | ||
"noDuplicateParameters": "off", | ||
"noFunctionAssign": "off", | ||
"noImportAssign": "off", | ||
"noRedeclare": "off", | ||
"noUnsafeNegation": "off", | ||
"useGetterReturn": "off" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"vcs": { | ||
"enabled": true, | ||
"clientKind": "git", | ||
"useIgnoreFile": 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like
biome
doesn't yet support HTML and MD files:https://biomejs.dev/internals/language-support