Skip to content
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

Temporarily disable @stylistic plugin in eslint-config #1688

Closed
wants to merge 1 commit into from
Closed
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
39 changes: 29 additions & 10 deletions libs/@guardian/eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @guardian/eslint-config

## 10.0.0-beta.1

### Changes

Temporarily removes `@stylistic/member-delimiter-style`, as installing it alongside `@eslint/compat` creates a types
clash in `node_modules`. This will be re-added in a future release.

https://github.com/eslint/rewrite/issues/104

## 10.0.0-beta.0

### Major Changes
Expand All @@ -14,7 +23,8 @@ It also includes configs for `jest`, `storybook` and `react`.

See the [README](README.md) for full details.

> ESLint 9 contains a lot of breaking changes, including a new config format. See their [migration guide](https://eslint.org/docs/latest/use/migrate-to-9.0.0) for more details.
> ESLint 9 contains a lot of breaking changes, including a new config format. See
> their [migration guide](https://eslint.org/docs/latest/use/migrate-to-9.0.0) for more details.
>
> Note that [ESLint 8 is EOL 2024-10-05](https://eslint.org/version-support/).

Expand All @@ -33,17 +43,21 @@ See the [README](README.md) for full details.

### Patch Changes

- 0382052: 1. All packages are now ES modules, although they should be compatible with CommonJS environments. 2. Adds entry points for projects that can consume [`package.json#exports`](https://nodejs.org/api/packages.html#exports), alongside `main`.
- 0382052: 1. All packages are now ES modules, although they should be compatible with CommonJS environments. 2. Adds
entry points for projects that can consume [`package.json#exports`](https://nodejs.org/api/packages.html#exports),
alongside `main`.

## 8.0.0

### Major Changes

- cc7aa7d: Requires curly braces in all circumstances.

This should help reduce noise in diffs, and remove ambiguity about when you should use curly braces (and possibly when a block starts and ends), especially for people unfamiliar with the language.
This should help reduce noise in diffs, and remove ambiguity about when you should use curly braces (and possibly when
a block starts and ends), especially for people unfamiliar with the language.

_Note that this rule is fixable, so running eslint with the `--fix` flag will automatically update your code to comply with the new setting._
_Note that this rule is fixable, so running eslint with the `--fix` flag will automatically update your code to comply
with the new setting._

## 7.0.1

Expand All @@ -64,7 +78,8 @@ See the [README](README.md) for full details.

### Major Changes

- 9e0cb43: `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` dependencies upgraded to next major version (6).
- 9e0cb43: `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` dependencies upgraded to next major
version (6).

## 5.0.0

Expand Down Expand Up @@ -122,14 +137,17 @@ See the [README](README.md) for full details.

We extended `plugin:prettier/recommended` which

1. used `eslint-config-prettier` to disable any white-space formatting rules that would conflict with our prettier config
2. used `eslint-plugin-prettier` to lint for formatting errors that did not match our prettier config
1. used `eslint-config-prettier` to disable any white-space formatting rules that would conflict with our prettier
config
2. used `eslint-plugin-prettier` to lint for formatting errors that did not match our prettier config

This is quite expensive, and although it means you could use `--fix` to apply prettier, it's not as fast as using prettier directly.
This is quite expensive, and although it means you could use `--fix` to apply prettier, it's not as fast as using
prettier directly.

### After

We still use `eslint-config-prettier` to avoid conflicts with our `prettier` config, but we no longer lint for errors (and therefore also don't fix them).
We still use `eslint-config-prettier` to avoid conflicts with our `prettier` config, but we no longer lint for
errors (and therefore also don't fix them).

### Recommendations

Expand All @@ -138,7 +156,8 @@ See the [README](README.md) for full details.
- via [editor integration](https://prettier.io/docs/en/editors.html)
- via a [pre-commit hook](https://prettier.io/docs/en/precommit.html)

If you prefer the way this used to work (applying `prettier` formatting as part of linting), add the [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) manually to your ESLint config.
If you prefer the way this used to work (applying `prettier` formatting as part of linting), add
the [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) manually to your ESLint config.

## 1.0.2

Expand Down
32 changes: 17 additions & 15 deletions libs/@guardian/eslint-config/configs/javascript.base.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import js from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
// import stylistic from '@stylistic/eslint-plugin';

export default {
name: '@guardian/javascript',
plugins: {
'@stylistic': stylistic,
// this currently creates a types clash in node_modules so disable this for now
// https://github.com/eslint/rewrite/issues/104
// '@stylistic': stylistic,
},
rules: {
...js.configs.recommended.rules,
Expand All @@ -14,18 +16,18 @@ export default {

// delimit members with semi-colons and require
// one at the end to keep diffs simpler
'@stylistic/member-delimiter-style': [
2,
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
// '@stylistic/member-delimiter-style': [
// 2,
// {
// multiline: {
// delimiter: 'semi',
// requireLast: true,
// },
// singleline: {
// delimiter: 'semi',
// requireLast: false,
// },
// },
// ],
},
};
3 changes: 1 addition & 2 deletions libs/@guardian/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@guardian/eslint-config",
"version": "10.0.0-beta.0",
"version": "10.0.0-beta.1",
"description": "ESLint config for Guardian JavaScript projects",
"type": "module",
"main": "index.js",
Expand All @@ -11,7 +11,6 @@
"dependencies": {
"@eslint/compat": "1.1.1",
"@eslint/js": "9.9.1",
"@stylistic/eslint-plugin": "2.6.4",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-eslint-comments": "3.2.0",
Expand Down
108 changes: 2 additions & 106 deletions pnpm-lock.yaml

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