Skip to content

Commit

Permalink
ci: Stop using prettier for formatting and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Jan 6, 2025
1 parent 1b91000 commit e4469af
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 160 deletions.
51 changes: 0 additions & 51 deletions .prettierrc.js

This file was deleted.

1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"dangmai.workspace-default-settings",
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"mjmlio.vscode-mjml",
"Vue.volar",
"vitest.explorer"
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.default.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
Expand All @@ -25,7 +25,6 @@
"typescript.format.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"workspace-default-settings.runOnActivation": true,
"prettier.prettierPath": "node_modules/prettier/index.cjs",
"eslint.probe": ["javascript", "typescript", "vue"],
"eslint.workingDirectories": [
{
Expand Down
31 changes: 25 additions & 6 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
"useIgnoreFile": true
},
"files": {
"include": [
"**/*.js",
"**/*.ts",
"**/*.json",
"**/*.vue",
"**/*.yml",
"**/*.md",
"**/*.css",
"**/*.scss"
],
"ignore": [
"**/.turbo",
"**/coverage",
Expand All @@ -22,11 +32,7 @@
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"attributePosition": "auto",
"ignore": [
// Handled by prettier
"**/*.vue"
]
"attributePosition": "auto"
},
"organizeImports": { "enabled": false },
"linter": {
Expand All @@ -47,5 +53,18 @@
"quoteStyle": "single",
"attributePosition": "auto"
}
}
},
"overrides": [
{
"include": ["*.svelte", "*.astro", "*.vue"],
"linter": {
"rules": {
"style": {
"useConst": "off",
"useImportType": "off"
}
}
}
}
]
}
9 changes: 1 addition & 8 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
pre-commit:
commands:
biome_check:
glob: 'packages/**/*.{js,ts,json}'
glob: 'packages/**/*.{js,ts,json,vue,yml,md,css,scss}'
run: ./node_modules/.bin/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
stage_fixed: true
skip:
- merge
- rebase
prettier_check:
glob: 'packages/**/*.{vue,yml,md,css,scss}'
run: ./node_modules/.bin/prettier --write --ignore-unknown --no-error-on-unmatched-pattern {staged_files}
stage_fixed: true
skip:
- merge
- rebase
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"worker": "./packages/cli/bin/n8n worker"
},
"devDependencies": {
"@biomejs/biome": "^1.9.0",
"@biomejs/biome": "^1.9.4",
"@n8n_io/eslint-config": "workspace:*",
"@types/jest": "^29.5.3",
"@types/node": "*",
Expand Down
4 changes: 2 additions & 2 deletions packages/@n8n/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"typecheck": "vue-tsc --noEmit",
"lint": "eslint . --ext .js,.ts,.vue --quiet",
"lintfix": "eslint . --ext .js,.ts,.vue --fix",
"format": "biome format --write src .storybook && prettier --write src/ --ignore-path ../../.prettierignore",
"format:check": "biome ci src .storybook && prettier --check src/ --ignore-path ../../.prettierignore",
"format": "biome format --write src .storybook",
"format:check": "biome ci src .storybook",
"storybook": "storybook dev -p 6006 --no-open",
"build:storybook": "storybook build"
},
Expand Down
10 changes: 2 additions & 8 deletions packages/@n8n_io/eslint-config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ const config = (module.exports = {
* https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base/rules
*/
'eslint-config-airbnb-typescript/base',

/**
* Config to disable ESLint rules covered by Prettier
*
* https://github.com/prettier/eslint-config-prettier
*/
'eslint-config-prettier',
],

rules: {
Expand Down Expand Up @@ -105,9 +98,10 @@ const config = (module.exports = {
/**
* https://eslint.org/docs/latest/rules/indent
*
* Delegated to Prettier.
* Delegated to Biome.
*/
indent: 'off',
'@typescript-eslint/indent': 'off',

/**
* https://eslint.org/docs/latest/rules/no-constant-binary-expression
Expand Down
1 change: 0 additions & 1 deletion packages/@n8n_io/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"@vue/eslint-config-typescript": "^13.0.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-lodash": "^7.4.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"build:storybook": "storybook build",
"storybook": "storybook dev -p 6006",
"chromatic": "chromatic",
"format": "biome format --write . && prettier --write . --ignore-path ../../.prettierignore",
"format:check": "biome ci . && prettier --check . --ignore-path ../../.prettierignore",
"format": "biome format --write .",
"format:check": "biome ci .",
"lint": "eslint src --ext .js,.ts,.vue --quiet",
"lintfix": "eslint src --ext .js,.ts,.vue --fix"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"dev": "pnpm serve",
"lint": "eslint src --ext .js,.ts,.vue --quiet",
"lintfix": "eslint src --ext .js,.ts,.vue --fix",
"format": "biome format --write . && prettier --write . --ignore-path ../../.prettierignore",
"format:check": "biome ci . && prettier --check . --ignore-path ../../.prettierignore",
"format": "biome format --write .",
"format:check": "biome ci .",
"serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vite --host 0.0.0.0 --port 8080 dev",
"test": "vitest run",
"test:dev": "vitest --silent=false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,15 @@ describe('tmpl Expression Parser', () => {
});

test('Multiple optional chains in an expression', () => {
expect(extendTransform('$json.test?.test2($json.test?.test2)')?.code).toBe(`window.chainCancelToken2 = ((window.chainValue2 = $json.test) ?? undefined) === undefined, window.chainCancelToken2 === true ? undefined : window.chainValue2.test2(
expect(
extendTransform('$json.test?.test2($json.test?.test2)')?.code,
).toBe(`window.chainCancelToken2 = ((window.chainValue2 = $json.test) ?? undefined) === undefined, window.chainCancelToken2 === true ? undefined : window.chainValue2.test2(
(window.chainCancelToken1 = ((window.chainValue1 = $json.test) ?? undefined) === undefined, window.chainCancelToken1 === true ? undefined : window.chainValue1.test2)
);`);

expect(extendTransform('$json.test?.test2($json.test.sum?.())')?.code).toBe(`window.chainCancelToken2 = ((window.chainValue2 = $json.test) ?? undefined) === undefined, window.chainCancelToken2 === true ? undefined : window.chainValue2.test2(
expect(
extendTransform('$json.test?.test2($json.test.sum?.())')?.code,
).toBe(`window.chainCancelToken2 = ((window.chainValue2 = $json.test) ?? undefined) === undefined, window.chainCancelToken2 === true ? undefined : window.chainValue2.test2(
(window.chainCancelToken1 = ((window.chainValue1 = extendOptional($json.test, "sum")) ?? undefined) === undefined, window.chainCancelToken1 === true ? undefined : window.chainValue1())
);`);
});
Expand Down
Loading

0 comments on commit e4469af

Please sign in to comment.