Skip to content

Commit

Permalink
Publish v0.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amikheychik committed Dec 1, 2024
1 parent b946a91 commit c2bbfa6
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 31 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@
:eslint-testing-library-rules: https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules
:eslint-unicorn-rules: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules


== v0.28.0

* *Migrated to a flat config*.
* *Using `typescript-eslint` package instead of `@typescript-eslint/*`*.
+
* Updated `typescript-eslint` to `8.16.0`:
** *Supports TypeScript v5.7.*
+
* Updated `@stylistic/eslint-plugin` to `2.11.0`.
* Updated `eslint-plugin-jest-dom` to `5.5.0`.
* Updated `eslint-plugin-jsdoc` to `50.6.0`.
* Updated `eslint-plugin-n` to `17.14.0`.
+
* Updated `eslint-plugin-promise` to `7.2.1`.
** Enabled the `link:{eslint-promise-rules}/prefer-catch.md[promise/prefer-catch]` rule as a warning.
+
* Upgraded `eslint-plugin-testing-library` to `7.0.0`.
* Patched `eslint-plugin-unicorn` to `56.0.1`.
+
* Removed `eslint-plugin-sonarjs`.


== v0.27.1

* Updated `eslint-plugin-jsdoc` to `50.5.0`.
Expand Down
45 changes: 45 additions & 0 deletions MIGRATION_GUIDE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,51 @@ Migration between minor versions follows the same steps:
** fix errors or check auto-fixes of warnings;
** check for the regressions.

== From `v0.27.1` to `0.28.0`

* Remove obsolete peer dependencies:
** `@typescript-eslint/eslint-plugin` (replaced by `typescript-eslint`)
** `@typescript-eslint/parser`
** `eslint-plugin-sonarjs`
+
* Rename `.eslintrc.js` into `eslint.config.js`
** Change configuration structure.
+
.Before
[source,javascript]
----
module.exports = {
extends: [
'@perfective/eslint-config',
],
----
+
.After
[source,javascript]
----
const perfectiveEslintConfig = require('@perfective/eslint-config');
module.exports = perfectiveEslintConfig.default;
----
+
* Disable and gradually enable new rules in the `eslint.config.js`.
+
[source,javascript]
----
const perfectiveEslintConfig = require('@perfective/eslint-config');
module.exports = [
...perfectiveEslintConfig.default,
{
files: ['**/*.[jt]s?(x)'],
rules: {
'promise/prefer-catch': 'off',
},
},
];
----


== From `v0.26.1` to `v0.27.1`

* Remove obsolete peer dependencies:
Expand Down
37 changes: 18 additions & 19 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ and https://eslint.style[ESLint Stylistic] plugin rules,
* `link:https://github.com/cartant/eslint-plugin-rxjs[eslint-plugin-rxjs]` _(optional)_;
* `link:https://github.com/eslint-community/eslint-plugin-security[eslint-plugin-security]`;
* `link:https://github.com/lydell/eslint-plugin-simple-import-sort[eslint-plugin-simple-import-sort]`;
* `link:https://github.com/SonarSource/eslint-plugin-sonarjs[eslint-plugin-sonarjs]`;
* `link:https://github.com/testing-library/eslint-plugin-testing-library[eslint-plugin-testing-library]` _(optional)_;
* `link:https://github.com/sindresorhus/eslint-plugin-unicorn[eslint-plugin-unicorn]`.
Expand All @@ -47,8 +46,6 @@ npm install --save-dev \
@stylistic/eslint-plugin-jsx \
@stylistic/eslint-plugin-ts \
@stylistic/eslint-plugin-plus \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
eslint \
eslint-import-resolver-typescript \
eslint-plugin-array-func \
Expand All @@ -60,8 +57,8 @@ npm install --save-dev \
eslint-plugin-promise \
eslint-plugin-security \
eslint-plugin-simple-import-sort \
eslint-plugin-sonarjs \
eslint-plugin-unicorn
eslint-plugin-unicorn \
typescript-eslint
----
+
. Install optional peer dependencies that add linting rules for the tools you use.
Expand All @@ -79,15 +76,13 @@ npm install --save-dev \
The `@perfective/eslint-config` automatically includes rules for these plugins,
if the dependency is installed.
+
. Require the configuration in your root `.eslintrc.js`.
. Require the configuration in your root `eslint.config.js`.
+
[source,javascript]
----
module.exports = {
extends: [
'@perfective/eslint-config',
],
};
const perfectiveEslintConfig = require('@perfective/eslint-config');
module.exports = perfectiveEslintConfig.default;
----
+
. `*.d.ts` files and `dist` directories are ignored by the configuration.
Expand All @@ -107,20 +102,24 @@ and is simplified by the custom config functions.
These functions and related types are exported in `@perfective/eslint-config/rules`
and match the rule name in `camelCase`.
If you need an extended configuration,
you can use these functions in the `.eslintrc.js` file:
you can use these functions in the `eslint.config.js` file:

[source,javascript]
----
const perfectiveEslintConfig = require('@perfective/eslint-config');
const rules = require('@perfective/eslint-config/rules'); // <.>
module.exports = {
extends: ['@perfective/eslint-config'],
rules: {
'simple-import-sort/imports': ['warn', rules.simpleImportSortImports([
'@perfective',
])],
module.exports = [
...perfectiveEslintConfig.default,
{
files: ['**/*.[jt]s?(x)'],
rules: {
'simple-import-sort/imports': ['warn', rules.simpleImportSortImports([
'@perfective',
])],
},
},
};
];
----
<1> Framework-specific packages, based on `@perfective/eslint-config`, re-export all the rules.
So rules should be required from those packages for correct `node_modules` resolution.
Expand Down
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ and [ESlint Stylistic](https://eslint.style) plugin rules,
- [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs) _(optional)_;
- [`eslint-plugin-security`](https://github.com/eslint-community/eslint-plugin-security);
- [`eslint-plugin-simple-import-sort`](https://github.com/lydell/eslint-plugin-simple-import-sort);
- [`eslint-plugin-sonarjs`](https://github.com/SonarSource/eslint-plugin-sonarjs);
- [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library) _(optional)_;
- [`eslint-plugin-unicorn`](https://github.com/sindresorhus/eslint-plugin-unicorn).

Expand All @@ -45,8 +44,6 @@ from issues that will be fixed automatically.
@stylistic/eslint-plugin-jsx \
@stylistic/eslint-plugin-ts \
@stylistic/eslint-plugin-plus \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
eslint \
eslint-import-resolver-typescript \
eslint-plugin-array-func \
Expand All @@ -58,8 +55,8 @@ from issues that will be fixed automatically.
eslint-plugin-promise \
eslint-plugin-security \
eslint-plugin-simple-import-sort \
eslint-plugin-sonarjs \
eslint-plugin-unicorn
eslint-plugin-unicorn \
typescript-eslint
```

2. Install optional peer dependencies that add linting rules for the tools you use.
Expand All @@ -76,10 +73,10 @@ from issues that will be fixed automatically.
The `@perfective/eslint-config` automatically includes rules for these plugins,
if the dependency is installed.

3. Require the configuration in your root `.eslintrc.js`.
3. Require the configuration in your root `eslint.config.js`.

```javascript
module.exports = {
extends: ['@perfective/eslint-config'],
};
const perfectiveEslintConfig = require('@perfective/eslint-config');
module.exports = perfectiveEslintConfig.default;
```
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@perfective/eslint-config",
"version": "0.27.1",
"version": "0.28.0",
"description": "ESLint shareable rules configuration",
"keywords": [
"code quality",
Expand Down

0 comments on commit c2bbfa6

Please sign in to comment.