Skip to content

chore: migrate to eslint version 9 #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

8 changes: 0 additions & 8 deletions .eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion .prettierrc.js

This file was deleted.

27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pnpm add -D stylelint
Then add the plugin to your webpack configuration. For example:

```js
const StylelintPlugin = require('stylelint-webpack-plugin');
const StylelintPlugin = require("stylelint-webpack-plugin");

module.exports = {
// ...
Expand Down Expand Up @@ -133,7 +133,7 @@ A string indicating the root of your files.
- Type:

```ts
type exclude = string | Array<string>;
type exclude = string | string[];
```

- Default: `['node_modules', compiler.options.output.path]`
Expand All @@ -145,7 +145,7 @@ Specify the files and/or directories to exclude. Must be relative to `options.co
- Type:

```ts
type extensions = string | Array<string>;
type extensions = string | string[];
```

- Default: `['css', 'scss', 'sass']`
Expand All @@ -157,7 +157,7 @@ Specify the extensions that should be checked.
- Type:

```ts
type files = string | Array<string>;
type files = string | string[];
```

- Default: `null`
Expand All @@ -181,9 +181,9 @@ If `true`, `stylelint` will fix as many errors as possible. The fixes are made t
- Type:

```ts
type formatter = string | (
results: Array<import('stylelint').LintResult>
) => string
type formatter =
| string
| ((results: import("stylelint").LintResult[]) => string);
```

- Default: `'string'`
Expand Down Expand Up @@ -304,10 +304,7 @@ type outputReport =
| {
filePath?: string | undefined;
formatter?:
| (
| string
| ((results: Array<import('stylelint').LintResult>) => string)
)
| (string | ((results: import("stylelint").LintResult[]) => string))
| undefined;
};
```
Expand All @@ -321,10 +318,10 @@ The `filePath` is relative to the webpack config: `output.path`.
You can pass in a different formatter for the output file. If none is passed in the default/configured formatter will be used.

```js
{
filePath: 'path/to/file';
formatter: 'json';
}
const outputReport = {
filePath: "path/to/file",
formatter: "json",
};
```

## Changelog
Expand Down
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ module.exports = (api) => {
return {
presets: [
[
'@babel/preset-env',
"@babel/preset-env",
{
targets: {
node: '18.12.0',
node: "18.12.0",
},
},
],
Expand Down
8 changes: 4 additions & 4 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
extends: ["@commitlint/config-conventional"],
rules: {
'header-max-length': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0],
"header-max-length": [0],
"body-max-line-length": [0],
"footer-max-line-length": [0],
},
};
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "eslint/config";
import configs from "eslint-config-webpack/configs.js";

export default defineConfig([
{
extends: [configs["recommended-dirty"]],
},
]);
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
collectCoverageFrom: ['src/**/*.js'],
collectCoverageFrom: ["src/**/*.js"],
collectCoverage: true,
testEnvironment: 'node',
testEnvironment: "node",
testTimeout: 60000,
};
8 changes: 4 additions & 4 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
'*': [
'prettier --cache --write --ignore-unknown',
'cspell --cache --no-must-find-files',
"*": [
"prettier --cache --write --ignore-unknown",
"cspell --cache --no-must-find-files",
],
'*.js': ['eslint --cache --fix'],
"*.js": ["eslint --cache --fix"],
};
Loading
Loading