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

Support ESLint v8 #1488

Merged
merged 30 commits into from
Oct 11, 2021
Merged

Support ESLint v8 #1488

merged 30 commits into from
Oct 11, 2021

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Aug 16, 2021

Fixes #1486

import {codeFrameColumns} from '@babel/code-frame';
import outdent from 'outdent';
// TODO: Find a better way to test output.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fisker fisker mentioned this pull request Sep 18, 2021
@sindresorhus
Copy link
Owner

ESLint 8 has been released: https://eslint.org/blog/2021/10/eslint-v8.0.0-released

@sindresorhus sindresorhus mentioned this pull request Oct 11, 2021
4 tasks
@fisker fisker changed the title [WIP]Support ESLint v8 Support ESLint v8 Oct 11, 2021
@fisker fisker marked this pull request as ready for review October 11, 2021 11:25
@sindresorhus sindresorhus merged commit e97ab7e into sindresorhus:main Oct 11, 2021
import {codeFrameColumns} from '@babel/code-frame';
import outdent from 'outdent';

const require = createRequire(import.meta.url);
const codeFrameColumnsOptions = {linesAbove: Number.POSITIVE_INFINITY, linesBelow: Number.POSITIVE_INFINITY};
// A simple version of `SourceCodeFixer.applyFixes`
// https://github.com/eslint/eslint/issues/14936#issuecomment-906746754
const applyFix = (code, {fix}) => `${code.slice(0, fix.range[0])}${fix.text}${code.slice(fix.range[1])}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a lot of noise to concat 3 variables, I'd use

Suggested change
const applyFix = (code, {fix}) => `${code.slice(0, fix.range[0])}${fix.text}${code.slice(fix.range[1])}`;
const applyFix = (code, {fix}) => code.slice(0, fix.range[0]) + fix.text + code.slice(fix.range[1]);

@fisker fisker deleted the eslint-8 branch October 12, 2021 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESLint 8 compatibility
3 participants