Skip to content

Commit

Permalink
Update ESLint (#5)
Browse files Browse the repository at this point in the history
* Update ESLint

* Convert eslint to flat config
  • Loading branch information
IanVS authored Mar 19, 2024
1 parent c592ec4 commit 8c29011
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 33 deletions.
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.experimental.useFlatConfig": true
}
28 changes: 28 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import noOnlyPlugin from "eslint-plugin-no-only-tests";
import eslint from "@eslint/js";

export default [
eslint.configs.recommended,
{
rules: {
semi: "error",
"prefer-const": "error",
},
},
{
files: ["**/*.js"],
languageOptions: {
globals: {
require: "readonly",
module: "readonly",
},
},
},
// Prevent .only in tests
{
plugins: {
"no-only-tests": noOnlyPlugin,
},
rules: { "no-only-tests/no-only-tests": "error" },
},
];
2 changes: 1 addition & 1 deletion index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function format(css) {
}

async function run(input, output, opts, postcssOpts = {}) {
let result = await postcss([plugin(opts)]).process(input, postcssOpts);
const result = await postcss([plugin(opts)]).process(input, postcssOpts);
expect(format(result.css)).toEqual(format(output));
expect(result.warnings()).toHaveLength(0);
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
"postcss": "^8.3.0"
},
"devDependencies": {
"@eslint/js": "^8.57.0",
"c8": "^7.11.3",
"clean-publish": "^3.4.2",
"eslint": "^8.0.1",
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint": "^8.57.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"postcss": "^8.3.11",
"prettier": "^2.6.2",
"vite": "^2.9.9",
Expand Down
15 changes: 9 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c29011

Please sign in to comment.