Skip to content

Commit

Permalink
chore: update to eslint 9 and lint project
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 25, 2024
1 parent 419e669 commit c1685bb
Show file tree
Hide file tree
Showing 33 changed files with 2,862 additions and 1,552 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ on:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install

- name: 🔠 Lint project
run: pnpm lint

test:
runs-on: ubuntu-latest
env:
Expand Down
12 changes: 6 additions & 6 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module.exports = {
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
]
]
};
node: 'current',
},
},
],
],
}
9 changes: 9 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-check
import antfu from '@antfu/eslint-config'

export default antfu().append({
files: ['**/test/**'],
rules: {
'no-console': 'off',
},
})
51 changes: 8 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "beasties-root",
"private": true,
"packageManager": "pnpm@9.12.2",
"description": "Inline critical CSS and lazy-load the rest.",
"license": "Apache-2.0",
"author": "The Chromium Authors",
"contributors": [
{
Expand All @@ -19,16 +19,9 @@
"url": "https://roe.dev"
}
],
"workspaces": {
"packages": [
"./packages/*"
],
"nohoist": [
"**/css-loader",
"**/file-loader",
"**/mini-css-extract-plugin",
"**/webpack"
]
"license": "Apache-2.0",
"engines": {
"node": ">=18.13.0"
},
"scripts": {
"build": "pnpm -r build",
Expand All @@ -38,49 +31,21 @@
"release": "npm run build -s && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish",
"test": "vitest --coverage"
},
"engines": {
"node": ">=18.13.0"
},
"prettier": {
"singleQuote": true,
"trailingComma": "none"
},
"eslintConfig": {
"extends": [
"standard",
"prettier"
],
"globals": {
"document": "readonly",
"DOMParser": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
}
}
},
"devDependencies": {
"@antfu/eslint-config": "^3.8.0",
"@babel/preset-env": "7.26.0",
"@vitest/coverage-v8": "2.1.3",
"babel-core": "6.26.3",
"cheerio": "1.0.0-rc.12",
"css-what": "6.1.0",
"eslint": "7.32.0",
"eslint-config-prettier": "6.15.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-n": "14.0.0",
"eslint-plugin-promise": "4.3.1",
"eslint-plugin-standard": "4.1.0",
"eslint": "9.13.0",
"jsdom": "16.7.0",
"microbundle": "0.15.1",
"prettier": "2.8.8",
"typescript": "^5.6.3",
"vitest": "2.1.3"
},
"resolutions": {
"beasties": "workspace:*"
},
"packageManager": "pnpm@9.12.2"
}
}
62 changes: 31 additions & 31 deletions packages/beasties-webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
"name": "beasties-webpack-plugin",
"version": "0.0.26",
"description": "Webpack plugin to inline critical CSS and lazy-load the rest.",
"main": "dist/beasties-webpack-plugin.js",
"module": "dist/beasties-webpack-plugin.mjs",
"source": "src/index.js",
"exports": {
"import": "./dist/beasties-webpack-plugin.mjs",
"require": "./dist/beasties-webpack-plugin.js",
"default": "./dist/beasties-webpack-plugin.mjs"
},
"files": [
"src",
"dist"
],
"license": "Apache-2.0",
"author": "The Chromium Authors",
"contributors": [
{
Expand All @@ -31,6 +18,12 @@
"url": "https://roe.dev"
}
],
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/danielroe/beasties",
"directory": "packages/beasties-webpack-plugin"
},
"keywords": [
"critical css",
"inline css",
Expand All @@ -39,16 +32,37 @@
"webpack plugin",
"performance"
],
"repository": {
"type": "git",
"url": "https://github.com/danielroe/beasties",
"directory": "packages/beasties-webpack-plugin"
"exports": {
"import": "./dist/beasties-webpack-plugin.mjs",
"require": "./dist/beasties-webpack-plugin.js",
"default": "./dist/beasties-webpack-plugin.mjs"
},
"main": "dist/beasties-webpack-plugin.js",
"module": "dist/beasties-webpack-plugin.mjs",
"source": "src/index.js",
"files": [
"dist",
"src"
],
"scripts": {
"build": "microbundle --target node --no-sourcemap -f cjs,esm",
"docs": "documentation readme -q --no-markdown-toc -a public -s Usage --sort-order alpha src",
"prepare": "npm run -s build"
},
"peerDependencies": {
"html-webpack-plugin": "^4.5.2"
},
"peerDependenciesMeta": {
"html-webpack-plugin": {
"optional": true
}
},
"dependencies": {
"beasties": "^0.0.16",
"minimatch": "^3.0.8",
"webpack-log": "^3.0.2",
"webpack-sources": "^1.4.3"
},
"devDependencies": {
"css-loader": "4.3.0",
"documentation": "13.2.5",
Expand All @@ -57,19 +71,5 @@
"microbundle": "0.15.1",
"mini-css-extract-plugin": "0.10.1",
"webpack": "4.47.0"
},
"dependencies": {
"beasties": "^0.0.16",
"minimatch": "^3.0.8",
"webpack-log": "^3.0.2",
"webpack-sources": "^1.4.3"
},
"peerDependencies": {
"html-webpack-plugin": "^4.5.2"
},
"peerDependenciesMeta": {
"html-webpack-plugin": {
"optional": true
}
}
}
Loading

0 comments on commit c1685bb

Please sign in to comment.