Skip to content

Commit

Permalink
chore: use biome instead of eslint & prettier for JS
Browse files Browse the repository at this point in the history
  • Loading branch information
nd0ut committed Jun 20, 2024
1 parent 18aac85 commit c3dc8c2
Show file tree
Hide file tree
Showing 8 changed files with 475 additions and 2,008 deletions.
35 changes: 0 additions & 35 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"*.{js,cjs}": ["eslint --fix", "prettier --write", "git add"],
"*.{js,cjs}": ["biome format --write", "git add"],
"*.css": ["stylelint --fix", "prettier --write --parser css", "git add"],
"*.json": ["prettier --write --parser json", "git add"],
"*.md": ["prettier --write --parser markdown", "git add"]
Expand Down
49 changes: 49 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 120,
"attributePosition": "auto",
"ignore": ["**/web", "**/package-lock.json"]
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"complexity": { "useLiteralKeys": "off" },
"correctness": { "noUnusedVariables": "warn" },
"style": {
"noParameterAssign": "off",
"useBlockStatements": "off",
"useConst": "off",
"useSingleVarDeclarator": "off",
"useTemplate": "off"
},
"suspicious": {
"noConsoleLog": "off",
"noDuplicateObjectKeys": "error",
"noPrototypeBuiltins": "off"
}
},
"ignore": ["**/web"]
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto"
}
},
"overrides": [{ "include": ["*.js"] }]
}
4 changes: 0 additions & 4 deletions blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export function applyFocusVisiblePolyfill(scope, callback) {
* first loads and anytime the window is blurred so that they are active when the window regains focus.
*/
function addInitialPointerMoveListeners() {
/* eslint-disable no-use-before-define */
document.addEventListener('mousemove', onInitialPointerMove);
document.addEventListener('mousedown', onInitialPointerMove);
document.addEventListener('mouseup', onInitialPointerMove);
Expand All @@ -167,11 +166,9 @@ export function applyFocusVisiblePolyfill(scope, callback) {
document.addEventListener('touchmove', onInitialPointerMove);
document.addEventListener('touchstart', onInitialPointerMove);
document.addEventListener('touchend', onInitialPointerMove);
/* eslint-enable no-use-before-define */
}

function removeInitialPointerMoveListeners() {
/* eslint-disable no-use-before-define */
document.removeEventListener('mousemove', onInitialPointerMove);
document.removeEventListener('mousedown', onInitialPointerMove);
document.removeEventListener('mouseup', onInitialPointerMove);
Expand All @@ -181,7 +178,6 @@ export function applyFocusVisiblePolyfill(scope, callback) {
document.removeEventListener('touchmove', onInitialPointerMove);
document.removeEventListener('touchstart', onInitialPointerMove);
document.removeEventListener('touchend', onInitialPointerMove);
/* eslint-enable no-use-before-define */
}

/**
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ export { toKebabCase } from './utils/toKebabCase.js';

export * from './env.js';

// eslint-disable-next-line import/export
export * from './types/index.js';
Loading

0 comments on commit c3dc8c2

Please sign in to comment.