Skip to content

Commit c1685bb

Browse files
committed
chore: update to eslint 9 and lint project
1 parent 419e669 commit c1685bb

33 files changed

+2862
-1552
lines changed

.github/workflows/ci.yml

+17
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ on:
1010
- main
1111

1212
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- run: corepack enable
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 18
22+
cache: pnpm
23+
24+
- name: 📦 Install dependencies
25+
run: pnpm install
26+
27+
- name: 🔠 Lint project
28+
run: pnpm lint
29+
1330
test:
1431
runs-on: ubuntu-latest
1532
env:

babel.config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ module.exports = {
44
'@babel/preset-env',
55
{
66
targets: {
7-
node: 'current'
8-
}
9-
}
10-
]
11-
]
12-
};
7+
node: 'current',
8+
},
9+
},
10+
],
11+
],
12+
}

eslint.config.mjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// @ts-check
2+
import antfu from '@antfu/eslint-config'
3+
4+
export default antfu().append({
5+
files: ['**/test/**'],
6+
rules: {
7+
'no-console': 'off',
8+
},
9+
})

package.json

+8-43
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "beasties-root",
33
"private": true,
4+
"packageManager": "[email protected]",
45
"description": "Inline critical CSS and lazy-load the rest.",
5-
"license": "Apache-2.0",
66
"author": "The Chromium Authors",
77
"contributors": [
88
{
@@ -19,16 +19,9 @@
1919
"url": "https://roe.dev"
2020
}
2121
],
22-
"workspaces": {
23-
"packages": [
24-
"./packages/*"
25-
],
26-
"nohoist": [
27-
"**/css-loader",
28-
"**/file-loader",
29-
"**/mini-css-extract-plugin",
30-
"**/webpack"
31-
]
22+
"license": "Apache-2.0",
23+
"engines": {
24+
"node": ">=18.13.0"
3225
},
3326
"scripts": {
3427
"build": "pnpm -r build",
@@ -38,49 +31,21 @@
3831
"release": "npm run build -s && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish",
3932
"test": "vitest --coverage"
4033
},
41-
"engines": {
42-
"node": ">=18.13.0"
43-
},
44-
"prettier": {
45-
"singleQuote": true,
46-
"trailingComma": "none"
47-
},
48-
"eslintConfig": {
49-
"extends": [
50-
"standard",
51-
"prettier"
52-
],
53-
"globals": {
54-
"document": "readonly",
55-
"DOMParser": "readonly"
56-
},
57-
"parserOptions": {
58-
"ecmaFeatures": {
59-
"jsx": true,
60-
"modules": true
61-
}
62-
}
63-
},
6434
"devDependencies": {
35+
"@antfu/eslint-config": "^3.8.0",
6536
"@babel/preset-env": "7.26.0",
6637
"@vitest/coverage-v8": "2.1.3",
6738
"babel-core": "6.26.3",
6839
"cheerio": "1.0.0-rc.12",
6940
"css-what": "6.1.0",
70-
"eslint": "7.32.0",
71-
"eslint-config-prettier": "6.15.0",
72-
"eslint-config-standard": "14.1.1",
73-
"eslint-plugin-import": "2.31.0",
74-
"eslint-plugin-n": "14.0.0",
75-
"eslint-plugin-promise": "4.3.1",
76-
"eslint-plugin-standard": "4.1.0",
41+
"eslint": "9.13.0",
7742
"jsdom": "16.7.0",
7843
"microbundle": "0.15.1",
7944
"prettier": "2.8.8",
45+
"typescript": "^5.6.3",
8046
"vitest": "2.1.3"
8147
},
8248
"resolutions": {
8349
"beasties": "workspace:*"
84-
},
85-
"packageManager": "[email protected]"
50+
}
8651
}

packages/beasties-webpack-plugin/package.json

+31-31
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22
"name": "beasties-webpack-plugin",
33
"version": "0.0.26",
44
"description": "Webpack plugin to inline critical CSS and lazy-load the rest.",
5-
"main": "dist/beasties-webpack-plugin.js",
6-
"module": "dist/beasties-webpack-plugin.mjs",
7-
"source": "src/index.js",
8-
"exports": {
9-
"import": "./dist/beasties-webpack-plugin.mjs",
10-
"require": "./dist/beasties-webpack-plugin.js",
11-
"default": "./dist/beasties-webpack-plugin.mjs"
12-
},
13-
"files": [
14-
"src",
15-
"dist"
16-
],
17-
"license": "Apache-2.0",
185
"author": "The Chromium Authors",
196
"contributors": [
207
{
@@ -31,6 +18,12 @@
3118
"url": "https://roe.dev"
3219
}
3320
],
21+
"license": "Apache-2.0",
22+
"repository": {
23+
"type": "git",
24+
"url": "https://github.com/danielroe/beasties",
25+
"directory": "packages/beasties-webpack-plugin"
26+
},
3427
"keywords": [
3528
"critical css",
3629
"inline css",
@@ -39,16 +32,37 @@
3932
"webpack plugin",
4033
"performance"
4134
],
42-
"repository": {
43-
"type": "git",
44-
"url": "https://github.com/danielroe/beasties",
45-
"directory": "packages/beasties-webpack-plugin"
35+
"exports": {
36+
"import": "./dist/beasties-webpack-plugin.mjs",
37+
"require": "./dist/beasties-webpack-plugin.js",
38+
"default": "./dist/beasties-webpack-plugin.mjs"
4639
},
40+
"main": "dist/beasties-webpack-plugin.js",
41+
"module": "dist/beasties-webpack-plugin.mjs",
42+
"source": "src/index.js",
43+
"files": [
44+
"dist",
45+
"src"
46+
],
4747
"scripts": {
4848
"build": "microbundle --target node --no-sourcemap -f cjs,esm",
4949
"docs": "documentation readme -q --no-markdown-toc -a public -s Usage --sort-order alpha src",
5050
"prepare": "npm run -s build"
5151
},
52+
"peerDependencies": {
53+
"html-webpack-plugin": "^4.5.2"
54+
},
55+
"peerDependenciesMeta": {
56+
"html-webpack-plugin": {
57+
"optional": true
58+
}
59+
},
60+
"dependencies": {
61+
"beasties": "^0.0.16",
62+
"minimatch": "^3.0.8",
63+
"webpack-log": "^3.0.2",
64+
"webpack-sources": "^1.4.3"
65+
},
5266
"devDependencies": {
5367
"css-loader": "4.3.0",
5468
"documentation": "13.2.5",
@@ -57,19 +71,5 @@
5771
"microbundle": "0.15.1",
5872
"mini-css-extract-plugin": "0.10.1",
5973
"webpack": "4.47.0"
60-
},
61-
"dependencies": {
62-
"beasties": "^0.0.16",
63-
"minimatch": "^3.0.8",
64-
"webpack-log": "^3.0.2",
65-
"webpack-sources": "^1.4.3"
66-
},
67-
"peerDependencies": {
68-
"html-webpack-plugin": "^4.5.2"
69-
},
70-
"peerDependenciesMeta": {
71-
"html-webpack-plugin": {
72-
"optional": true
73-
}
7474
}
7575
}

0 commit comments

Comments
 (0)