Skip to content

Commit

Permalink
Upgrade Node.js and migrate prettier/stylelint/eslint to Biome
Browse files Browse the repository at this point in the history
  • Loading branch information
yoriiis committed Nov 19, 2024
1 parent 2a755fa commit 0692bd8
Show file tree
Hide file tree
Showing 42 changed files with 11,139 additions and 14,144 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
uses: yoriiis/actions/.github/workflows/test-and-build.yml@main
with:
node-version: 18
node-version: 22
command-build: |
npm run release:v3
npm run release:v2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ jobs:
lint:
uses: yoriiis/actions/.github/workflows/lint.yml@main
with:
node-version: 22
publint-status: false
eslint-status: false
stylelint-status: false
biome-status: true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.12.0
lts/jod
11 changes: 3 additions & 8 deletions abtasty-debugger.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}
],
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "biomejs.biome",
"[javascript][typescript][typescriptreact][postcss][html][markdown][json]": {
"editor.formatOnSave": true,
"editor.tabSize": 4,
Expand All @@ -32,15 +32,10 @@
"search.exclude": {
"**/node_modules": true
},
"files.eol": "\n",
"files.eol": "\n"
},
"extensions": {
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"csstools.postcss"
]
"recommendations": ["esbenp.prettier-vscode", "biomejs.biome", "csstools.postcss"]
},
"launch": {
"configurations": [
Expand Down
42 changes: 42 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": {
"ignoreUnknown": false,
"ignore": ["**/node_modules", "**/coverage", "**/web", "**/lib"]
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "tab",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"attributePosition": "auto",
"bracketSpacing": true
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": { "noForEach": "off" },
"suspicious": { "noExplicitAny": "off" },
"correctness": { "useJsxKeyInIterable": "off" }
}
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "none",
"semicolons": "asNeeded",
"arrowParentheses": "always",
"bracketSameLine": true,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
}
}
}
62 changes: 0 additions & 62 deletions config/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion config/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function (api) {
module.exports = (api) => {
api.cache(true)

const presets = [
Expand Down
5 changes: 2 additions & 3 deletions config/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const crypto = require('crypto')
const crypto = require('node:crypto')
const md5 = (string) => crypto.createHash('md5').update(string).digest('hex')

module.exports = (api) => {
Expand All @@ -12,8 +12,7 @@ module.exports = (api) => {
[
'postcss-custom-properties-transformer',
{
transformer: ({ property }) =>
isProduction ? md5(property).slice(0, 4) : property
transformer: ({ property }) => (isProduction ? md5(property).slice(0, 4) : property)
}
],
[
Expand Down
19 changes: 0 additions & 19 deletions config/prettier.config.js

This file was deleted.

12 changes: 0 additions & 12 deletions config/stylelint.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs')
const path = require('path')
const fs = require('node:fs')
const path = require('node:path')
const webpack = require('webpack')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const TerserPlugin = require('terser-webpack-plugin')
Expand Down
Loading

0 comments on commit 0692bd8

Please sign in to comment.