Skip to content

Commit 2714b24

Browse files
authored
Merge pull request #105 from yoriiis/feat/biome
Biome migration and Node.js upgrade
2 parents c34408b + 9c4c720 commit 2714b24

15 files changed

+1062
-2342
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
strategy:
1414
matrix:
15-
node-version: [16, 18, 20]
15+
node-version: [18, 20, 22]
1616
os: [ubuntu-latest, macos-latest]
1717
uses: yoriiis/actions/.github/workflows/test-and-build.yml@main
1818
with:

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ jobs:
1414
lint:
1515
uses: yoriiis/actions/.github/workflows/lint.yml@main
1616
with:
17+
node-version: 20
1718
stylelint-status: false
19+
eslint-status: false
20+
biome-status: true
1821
eslint-config: 'config/.eslintrc.cjs'

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/iron
1+
lts/jod

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Example of the webpack configuration with multiple entry points which share comm
207207

208208
```js
209209
import ChunksWebpackPlugin from 'chunks-webpack-plugin';
210-
import path from 'path';
210+
import path from 'node:path';
211211

212212
const __filename = fileURLToPath(import.meta.url);
213213
const __dirname = path.dirname(__filename);

biome.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
4+
"files": {
5+
"ignoreUnknown": false,
6+
"ignore": ["**/node_modules", "**/coverage", "**/dist", "**/lib", "**/types"]
7+
},
8+
"formatter": {
9+
"enabled": true,
10+
"useEditorconfig": true,
11+
"formatWithErrors": false,
12+
"indentStyle": "tab",
13+
"indentWidth": 2,
14+
"lineEnding": "lf",
15+
"lineWidth": 100,
16+
"attributePosition": "auto",
17+
"bracketSpacing": true
18+
},
19+
"organizeImports": { "enabled": true },
20+
"linter": {
21+
"enabled": true,
22+
"rules": {
23+
"recommended": true,
24+
"complexity": { "noForEach": "off" },
25+
"suspicious": { "noExplicitAny": "off" }
26+
}
27+
},
28+
"javascript": {
29+
"formatter": {
30+
"jsxQuoteStyle": "double",
31+
"quoteProperties": "asNeeded",
32+
"trailingCommas": "none",
33+
"semicolons": "always",
34+
"arrowParentheses": "always",
35+
"bracketSameLine": true,
36+
"quoteStyle": "single",
37+
"attributePosition": "auto",
38+
"bracketSpacing": true
39+
}
40+
}
41+
}

chunks-webpack-plugin.code-workspace

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66
],
77
"settings": {
8-
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"editor.defaultFormatter": "biomejs.biome",
99
"[javascript][typescript][postcss][html][markdown][json]": {
1010
"editor.formatOnSave": true,
1111
"editor.tabSize": 4,
@@ -32,11 +32,7 @@
3232
"files.eol": "\n"
3333
},
3434
"extensions": {
35-
"recommendations": [
36-
"davidanson.vscode-markdownlint",
37-
"esbenp.prettier-vscode",
38-
"dbaeumer.vscode-eslint"
39-
]
35+
"recommendations": ["davidanson.vscode-markdownlint", "biomejs.biome", "dbaeumer.vscode-eslint"]
4036
},
4137
"launch": {
4238
"configurations": [
@@ -48,4 +44,4 @@
4844
}
4945
]
5046
}
51-
}
47+
}

config/.eslintrc.cjs

Lines changed: 0 additions & 54 deletions
This file was deleted.

config/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
{
1010
diagnostics: {
1111
// Disable error reporting with import assertions
12-
ignoreCodes: ['TS2821']
12+
ignoreCodes: ['TS2823']
1313
}
1414
}
1515
]

config/prettier.config.cjs

Lines changed: 0 additions & 20 deletions
This file was deleted.

example/webpack.config.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import path from 'path';
2-
import { fileURLToPath } from 'url';
1+
import path from 'node:path';
2+
import { fileURLToPath } from 'node:url';
3+
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
34
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
45
import TerserJSPlugin from 'terser-webpack-plugin';
5-
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
66
import ChunksWebpackPlugin from '../lib/index.js';
77

88
const __filename = fileURLToPath(import.meta.url);
99
const __dirname = path.dirname(__filename);
1010

11-
export default (env, argv) => {
11+
export default (_env, argv) => {
1212
const isProduction = argv.mode === 'production';
1313

1414
return {
@@ -29,7 +29,7 @@ export default (env, argv) => {
2929
output: {
3030
path: path.resolve(__dirname, './dist'),
3131
publicPath: '/dist/',
32-
filename: `js/[name].js`
32+
filename: 'js/[name].js'
3333
},
3434
module: {
3535
rules: [
@@ -58,10 +58,8 @@ export default (env, argv) => {
5858
}),
5959
new ChunksWebpackPlugin({
6060
filename: '/templates/[name]-[type].html',
61-
templateStyle: (name) =>
62-
`<link rel="stylesheet" href="https://cdn.domain.com${name}" />`,
63-
templateScript: (name) =>
64-
`<script defer src="https://cdn.domain.com${name}"></script>`,
61+
templateStyle: (name) => `<link rel="stylesheet" href="https://cdn.domain.com${name}" />`,
62+
templateScript: (name) => `<script defer src="https://cdn.domain.com${name}"></script>`,
6563
generateChunksManifest: true,
6664
generateChunksFiles: true
6765
})

0 commit comments

Comments
 (0)