Release v0.2.0 #5
@ -1,7 +1,8 @@
|
|||||||
import ESLintPlugin from 'eslint-webpack-plugin';
|
import ESLintPlugin from 'eslint-webpack-plugin';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import semver from 'semver';
|
||||||
import type { WebpackOptions } from 'types';
|
import type { WebpackOptions } from 'types';
|
||||||
import { hasPackage } from 'utils/helpers';
|
import { getPackageVersion, hasPackage } from 'utils/helpers';
|
||||||
|
|
||||||
const getEslintPlugin = (options: WebpackOptions) => {
|
const getEslintPlugin = (options: WebpackOptions) => {
|
||||||
const {
|
const {
|
||||||
@ -11,7 +12,8 @@ const getEslintPlugin = (options: WebpackOptions) => {
|
|||||||
} = {},
|
} = {},
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
if (!hasPackage('eslint') || eslintPlugin === 'off') {
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
|
if (!hasPackage('eslint') || eslintPlugin === 'off' || semver.lt(getPackageVersion('eslint')!, '8.0.0')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user