Skip to content

Commit

Permalink
Biome (#1075)
Browse files Browse the repository at this point in the history
* configure Biome

* import type, no useless types

* void is confusing inside a union type. Unsafe fix: Use undefined instead.

* useEnumInitializers

* prefer template literals

* useSelfClosingElements

* useExhaustiveDependencies

* optimize import

* noBannedTypes

* useLiteralKeys

* remove Eslint and prettier from documentation

* fix ts linting errors
  • Loading branch information
Richard87 authored Sep 5, 2024
1 parent 22877a3 commit c65f79a
Show file tree
Hide file tree
Showing 251 changed files with 1,756 additions and 3,241 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/radix-web-console-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: npm ci
- run: npm run lint
- run: biome ci .
- run: npm run lint-ts

validate-radixconfig:
Expand Down
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,11 @@ Note that the biggest section of ITCSS, "components", is not defined here. Compo

## Coding standards

Coding standards are enforced by [Prettier](https://prettier.io/) and [ESLint](https://eslint.org/). Please use appropriate plugins for your editor:

- [ESLint for VS Code](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [ESLint for Sublime Text](https://github.com/SublimeLinter/SublimeLinter-eslint)
- [ESLint for Atom](https://atom.io/packages/linter-eslint)
- [Prettier for VS Code](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
- [Prettier for Sublime Text](https://github.com/danreeves/sublime-prettier)
- [Prettier for Atom](https://atom.io/packages/prettier-atom)
Coding standards are enforced by [Biomejs](https://Biomejs.dev/) . Please use appropriate plugins for your editor:

To get ESLint to run properly from your editor you will need to have it set up in your local environment (not the dev Docker container). You can do that by running:

npm install --only=dev && npm install --no-save eslint@5

Note the "no save" `eslint` installation — this is to avoid a conflict with the version bundled with CRA, which sometimes does not work from within a code editor, without attempting to install another `eslint` version in the build.
npm install

You can also run linting within the Docker container:

Expand Down
62 changes: 62 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": [
".vscode/",
"src/style/hex-to-hsl.js",
"build/",
"dist/",
"src/store/*.ts"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"quoteStyle": "single",
"quoteProperties": "asNeeded",
"semicolons": "always",
"trailingCommas": "es5"
}
},
"linter": {
"rules": {
"security": {
"noDangerouslySetInnerHtml": "off"
},
"complexity": {
"noForEach": "off",
"noUselessFragments": "off",
"useArrowFunction": "off"
},
"style": {
"noUselessElse": "off",
"useNumberNamespace": "off",
"noNonNullAssertion": "off",
"noParameterAssign": "off"
},
"suspicious": {
"noArrayIndexKey": "off",
"noAssignInExpressions": "off",
"noDoubleEquals": "off"
},
"performance": {
"noAccumulatingSpread": "off"
},
"a11y": {
"noRedundantRoles": "off",
"useKeyWithClickEvents": "off"
}
}
}
}
Loading

0 comments on commit c65f79a

Please sign in to comment.