Skip to content

Commit

Permalink
Merge pull request #60 from Boehringer-Ingelheim/next
Browse files Browse the repository at this point in the history
Release v6
  • Loading branch information
matzehecht authored Dec 18, 2024
2 parents a467b4e + 693a29f commit d28b27f
Show file tree
Hide file tree
Showing 9 changed files with 2,343 additions and 1,894 deletions.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
npx --no -- commitlint --edit "$1" || {
commitlint --edit "$1" || {
echo "Try \033[1;32mnpx git-cz --disable-emoji\033[0;37m to commit and be align with the conventions or use \033[1;33mgit commit -m \"yolo!\" --no-verify\033[0;37m to bypass the commit-msg hook."
exit 1
}
92 changes: 92 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,95 @@
# [6.0.0-next.7](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v6.0.0-next.6...v6.0.0-next.7) (2024-12-17)


### Features

* **deps:** update eslint-plugin-playwright to ^2.1.0 ([6f75084](https://github.com/Boehringer-Ingelheim/eslint-config/commit/6f750849246916b44032771f1ffa3a8afa2232c6))
* **deps:** update eslint-plugin-react-hooks to ^5.1.0 ([76cd621](https://github.com/Boehringer-Ingelheim/eslint-config/commit/76cd6214c3c6df2c34c6d61856322852d5782b47))


### Reverts

* "chore(deps): update some major versions" ([28b4c17](https://github.com/Boehringer-Ingelheim/eslint-config/commit/28b4c178296b60ed97236be8fd9c19b0a25da17d))


### BREAKING CHANGES

* **deps:** major update for eslint-plugin-react-hooks to ^5.1.0
* **deps:** major update for eslint-plugin-playwright to ^2.1.0

# [6.0.0-next.6](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v6.0.0-next.5...v6.0.0-next.6) (2024-12-13)


### Bug Fixes

* remove eslint-plugin-deprecation as this is handled by sonarjs and typescript-eslint now ([931e781](https://github.com/Boehringer-Ingelheim/eslint-config/commit/931e7815f581ba6d8ed55346fbe77c7bfada487c))


### chore

* **deps:** update major release of eslint-plugin-perfectionist ([56b26af](https://github.com/Boehringer-Ingelheim/eslint-config/commit/56b26af104fd3a696774502fee964df64849beb5))
* **deps:** update majore release of typescript-eslint ([c929b6e](https://github.com/Boehringer-Ingelheim/eslint-config/commit/c929b6e17d07746c932185cf5d796e15711c6d64))
* **deps:** update some major versions ([bd583e3](https://github.com/Boehringer-Ingelheim/eslint-config/commit/bd583e33ae25adc18110ff57c7308963453d9626))


### BREAKING CHANGES

* **deps:** update major release of typescript-eslint with new rules enabled
* **deps:** major update and rule changes of eslint perfectionist
* **deps:** major updates for eslint-sonarjs with new rules enabled

# [6.0.0-next.5](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v6.0.0-next.4...v6.0.0-next.5) (2024-12-13)


### Bug Fixes

* **prettier-disable:** add prettier-disable to npm release ([617691f](https://github.com/Boehringer-Ingelheim/eslint-config/commit/617691fdc9d6181bfd263c7884bd0a8ad070f4d2))

# [6.0.0-next.4](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v6.0.0-next.3...v6.0.0-next.4) (2024-12-13)


### Features

* **prettier-disable:** adds a prettier-disable shared config ([4e8000c](https://github.com/Boehringer-Ingelheim/eslint-config/commit/4e8000c543f629b6eb452181f230924c0b4e6f58))

# [6.0.0-next.3](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v6.0.0-next.2...v6.0.0-next.3) (2024-09-16)


### Bug Fixes

* **typescript:** switch from eslint dot-notation to @typescript-eslint/do-notation ([0327e74](https://github.com/Boehringer-Ingelheim/eslint-config/commit/0327e74b727e7417ad595ae3d0ac674dcf930f0b))

# [6.0.0-next.2](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v6.0.0-next.1...v6.0.0-next.2) (2024-08-07)


### Features

* **deps:** update eslint-plugin-perfectionist@3 ([1ca8eac](https://github.com/Boehringer-Ingelheim/eslint-config/commit/1ca8eacb1add6099f86b7abee1e7da7e5bad05a7))


### BREAKING CHANGES

* **deps:** update to eslint-plugin-perfectionist@3

# [6.0.0-next.1](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v5.1.0-next.1...v6.0.0-next.1) (2024-08-07)


### Features

* **base:** add 'eslint-plugin-deprecation' to report usage of deprecated code ([00939c6](https://github.com/Boehringer-Ingelheim/eslint-config/commit/00939c646965d72a93b7716d610166ed90f3bd60))


### BREAKING CHANGES

* **base:** add 'eslint-plugin-deprecation' to base configuration

# [5.1.0-next.1](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v5.0.3...v5.1.0-next.1) (2024-07-24)


### Features

* **deps:** update dependencies ([9166ce6](https://github.com/Boehringer-Ingelheim/eslint-config/commit/9166ce676ce982d4332309a0f441c9013533b502))

## [5.0.3](https://github.com/Boehringer-Ingelheim/eslint-config/compare/v5.0.2...v5.0.3) (2024-07-15)


Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,26 @@ This shared ESLint configuration is designed to enforce best practices and recom
- [`playwright/prefer-to-have-length`](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-to-have-length.md): enforces the use of `.toHaveLength()` instead of `.toEqual(n)` when testing the length of an object.
- [`playwright/require-top-level-describe`](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/require-top-level-describe.md): requires tests to be organized into top-level `describe()` blocks.

### `@boehringer-ingelheim/eslint-config/prettier-disable`

```js
module.exports = {
extends: [
'@boehringer-ingelheim/eslint-config/base/strict',
// Following needs eslint-plugin-prettier to be installed as described by https://github.com/prettier/eslint-plugin-prettier
// Should be second to last
'plugin:prettier/recommended',
// Should be last
'@boehringer-ingelheim/eslint-config/prettier-disable'
],
};
```

This shared ESLint configuration is wrapper around [`eslint-config-disable`](https://github.com/prettier/eslint-config-prettier), which is used to turn off all rules that are unnecessary or might conflict with Prettier. This wrapper reenables a few rules that can be used with our shared configurations as we are using specific options of those rules which are compatible with Prettier (see [Special Rules](https://github.com/prettier/eslint-config-prettier#special-rules)). Following rules are reenabled:

- [`curly`](https://github.com/eslint/eslint/blob/main/docs/src/rules/curly.md) with the (default) option "all": Enforce consistent brace style for all control statements
- [`no-confusing-arrow`](https://github.com/eslint/eslint/blob/main/docs/src/rules/no-confusing-arrow.md) with allowParens `false` and onlyOneSimpleParam `true`: Disallow arrow functions where they could be confused with comparisons.

## Local Development

### Install Dependencies
Expand Down
62 changes: 40 additions & 22 deletions base/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
const { SORT_CLASSES_GROUPS, SORT_IMPORTS_GROUPS } = require('../lib/eslint-plugin-perfectionist');
const {
SORT_CLASSES_GROUPS,
SORT_IMPORTS_GROUPS,
SORT_INTERSECTION_TYPES_GROUPS,
} = require('../lib/eslint-plugin-perfectionist');

/**
* Workaround to allow ESLint to resolve plugins that were installed
* by an external config, see https://github.com/eslint/eslint/issues/3458.
*/
require('@rushstack/eslint-patch/modern-module-resolution');
const eslintPluginPerfectionist = require('eslint-plugin-perfectionist');

/** @type {import('eslint').ESLint.ConfigData & { parserOptions: import('eslint').ESLint.ConfigData['parserOptions'] & import('@typescript-eslint/parser').ParserOptions } } */
module.exports = {
Expand All @@ -17,7 +22,7 @@ module.exports = {
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:perfectionist/recommended-natural',
'plugin:perfectionist/recommended-natural-legacy',
'plugin:sonarjs/recommended-legacy',
],
overrides: [
Expand Down Expand Up @@ -61,11 +66,11 @@ module.exports = {
'@typescript-eslint/sort-type-constituents': 'off', // disabled due to conflict with eslint-plugin-perfectionist

// eslint: https://github.com/eslint/eslint/tree/main/lib/rules
'@typescript-eslint/dot-notation': ['error', { allowPattern: '^[a-z]+(_[a-z]+)+$' }],
'arrow-body-style': ['error', 'as-needed'],
camelcase: 'warn',
curly: 'error',
'default-case': 'error',
'dot-notation': ['error', { allowPattern: '^[a-z]+(_[a-z]+)+$' }],
eqeqeq: 'error',
'logical-assignment-operators': ['error', 'never'],
'no-console': ['warn', { allow: ['warn', 'error'] }],
Expand Down Expand Up @@ -104,31 +109,44 @@ module.exports = {
'import/no-named-as-default-member': 'off',

// eslint-plugin-perfectionist: https://github.com/azat-io/eslint-plugin-perfectionist
'perfectionist/sort-array-includes': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-astro-attributes': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-classes': ['error', { groups: SORT_CLASSES_GROUPS, 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-enums': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-exports': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-classes': [
'error',
{
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-classes'][1],
groups: SORT_CLASSES_GROUPS,
},
],
'perfectionist/sort-imports': [
'error',
{
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-imports'][1],
groups: SORT_IMPORTS_GROUPS,
'ignore-case': true,
'newlines-between': 'ignore',
type: 'natural',
newlinesBetween: 'ignore',
},
],
'perfectionist/sort-intersection-types': [
'error',
{
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules[
'perfectionist/sort-intersection-types'
][1],
groups: SORT_INTERSECTION_TYPES_GROUPS,
},
],
'perfectionist/sort-named-imports': [
'error',
{
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-named-imports'][1],
ignoreAlias: true,
},
],
'perfectionist/sort-objects': [
'error',
{
...eslintPluginPerfectionist.configs['recommended-natural-legacy'].rules['perfectionist/sort-objects'][1],
partitionByComment: true,
},
],
'perfectionist/sort-interfaces': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-intersection-types': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-jsx-props': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-maps': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-named-exports': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-named-imports': ['error', { 'ignore-alias': true, 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-object-types': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-objects': ['error', { 'ignore-case': true, 'partition-by-comment': true, type: 'natural' }],
'perfectionist/sort-svelte-attributes': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-union-types': ['error', { 'ignore-case': true, type: 'natural' }],
'perfectionist/sort-vue-attributes': ['error', { 'ignore-case': true, type: 'natural' }],
},
settings: {
'import/resolver': {
Expand Down
24 changes: 23 additions & 1 deletion lib/eslint-plugin-perfectionist.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const SORT_IMPORTS_GROUPS = [
['external', 'external-type'],
['internal', 'internal-type'],
['parent', 'parent-type', 'sibling', 'sibling-type', 'index', 'index-type'],
['style', 'side-effect'],
'style',
['side-effect-style', 'side-effect'],
'object',
'unknown',
];
Expand All @@ -35,7 +36,28 @@ const SORT_CLASSES_GROUPS = [
'unknown',
];

/**
* This array can be used to configure the perfectionist/sort-intersection-types rule.
* The following group names are available for configuration: https://perfectionist.dev/rules/sort-intersection-types#groups
*/
const SORT_INTERSECTION_TYPES_GROUPS = [
'conditional',
'function',
'import',
'intersection',
'union',
'named',
'keyword',
'literal',
'operator',
'tuple',
'object',
'nullish',
'unknown',
];

module.exports = {
SORT_CLASSES_GROUPS,
SORT_IMPORTS_GROUPS,
SORT_INTERSECTION_TYPES_GROUPS,
};
Loading

0 comments on commit d28b27f

Please sign in to comment.