Skip to content

Commit

Permalink
Merge pull request #105 from yoriiis/feat/biome
Browse files Browse the repository at this point in the history
Biome migration and Node.js upgrade
  • Loading branch information
yoriiis authored Nov 18, 2024
2 parents c34408b + 9c4c720 commit 2714b24
Show file tree
Hide file tree
Showing 15 changed files with 1,062 additions and 2,342 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:
strategy:
matrix:
node-version: [16, 18, 20]
node-version: [18, 20, 22]
os: [ubuntu-latest, macos-latest]
uses: yoriiis/actions/.github/workflows/test-and-build.yml@main
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ jobs:
lint:
uses: yoriiis/actions/.github/workflows/lint.yml@main
with:
node-version: 20
stylelint-status: false
eslint-status: false
biome-status: true
eslint-config: 'config/.eslintrc.cjs'
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/iron
lts/jod
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Example of the webpack configuration with multiple entry points which share comm

```js
import ChunksWebpackPlugin from 'chunks-webpack-plugin';
import path from 'path';
import path from 'node:path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down
41 changes: 41 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": {
"ignoreUnknown": false,
"ignore": ["**/node_modules", "**/coverage", "**/dist", "**/lib", "**/types"]
},
"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" }
}
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "none",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSameLine": true,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
}
}
}
10 changes: 3 additions & 7 deletions chunks-webpack-plugin.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][postcss][html][markdown][json]": {
"editor.formatOnSave": true,
"editor.tabSize": 4,
Expand All @@ -32,11 +32,7 @@
"files.eol": "\n"
},
"extensions": {
"recommendations": [
"davidanson.vscode-markdownlint",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
"recommendations": ["davidanson.vscode-markdownlint", "biomejs.biome", "dbaeumer.vscode-eslint"]
},
"launch": {
"configurations": [
Expand All @@ -48,4 +44,4 @@
}
]
}
}
}
54 changes: 0 additions & 54 deletions config/.eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
{
diagnostics: {
// Disable error reporting with import assertions
ignoreCodes: ['TS2821']
ignoreCodes: ['TS2823']
}
}
]
Expand Down
20 changes: 0 additions & 20 deletions config/prettier.config.cjs

This file was deleted.

16 changes: 7 additions & 9 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import path from 'path';
import { fileURLToPath } from 'url';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import TerserJSPlugin from 'terser-webpack-plugin';
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
import ChunksWebpackPlugin from '../lib/index.js';

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

export default (env, argv) => {
export default (_env, argv) => {
const isProduction = argv.mode === 'production';

return {
Expand All @@ -29,7 +29,7 @@ export default (env, argv) => {
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: `js/[name].js`
filename: 'js/[name].js'
},
module: {
rules: [
Expand Down Expand Up @@ -58,10 +58,8 @@ export default (env, argv) => {
}),
new ChunksWebpackPlugin({
filename: '/templates/[name]-[type].html',
templateStyle: (name) =>
`<link rel="stylesheet" href="https://cdn.domain.com${name}" />`,
templateScript: (name) =>
`<script defer src="https://cdn.domain.com${name}"></script>`,
templateStyle: (name) => `<link rel="stylesheet" href="https://cdn.domain.com${name}" />`,
templateScript: (name) => `<script defer src="https://cdn.domain.com${name}"></script>`,
generateChunksManifest: true,
generateChunksFiles: true
})
Expand Down
Loading

0 comments on commit 2714b24

Please sign in to comment.