fix: eslint
This commit is contained in:
parent
329e1b6680
commit
13b7bf465b
|
@ -9,6 +9,7 @@ const {join} = require('path');
|
||||||
|
|
||||||
const D = require('../../debug');
|
const D = require('../../debug');
|
||||||
const {default: Flecks} = require('../flecks');
|
const {default: Flecks} = require('../flecks');
|
||||||
|
const R = require('../../require');
|
||||||
|
|
||||||
const debug = D('@flecks/core/server/build/eslint.config.js');
|
const debug = D('@flecks/core/server/build/eslint.config.js');
|
||||||
|
|
||||||
|
@ -24,7 +25,10 @@ if (FLECKS_CORE_SYNC_FOR_ESLINT) {
|
||||||
debug('bootstrapping flecks...');
|
debug('bootstrapping flecks...');
|
||||||
const flecks = Flecks.bootstrap();
|
const flecks = Flecks.bootstrap();
|
||||||
debug('bootstrapped');
|
debug('bootstrapped');
|
||||||
const eslintConfig = flecks.buildConfig('eslint.config.js', FLECKS_CORE_BUILD_TARGET);
|
const eslintConfigFn = R(
|
||||||
|
flecks.buildConfig('default.eslint.config.js', FLECKS_CORE_BUILD_TARGET),
|
||||||
|
);
|
||||||
|
const eslintConfig = eslintConfigFn(flecks);
|
||||||
const webpackConfig = flecks.buildConfig('webpack.config.js', FLECKS_CORE_BUILD_TARGET);
|
const webpackConfig = flecks.buildConfig('webpack.config.js', FLECKS_CORE_BUILD_TARGET);
|
||||||
eslintConfig.settings['import/resolver'].webpack = {
|
eslintConfig.settings['import/resolver'].webpack = {
|
||||||
config: {
|
config: {
|
||||||
|
|
|
@ -113,9 +113,7 @@ export default (program, flecks) => {
|
||||||
process.env.FLECKS_CORE_BUILD_TARGET = target;
|
process.env.FLECKS_CORE_BUILD_TARGET = target;
|
||||||
const cmd = [
|
const cmd = [
|
||||||
'npx', 'eslint',
|
'npx', 'eslint',
|
||||||
'--config', flecks.buildConfig('.eslintrc.js', target),
|
'--config', flecks.buildConfig('eslint.config.js', target),
|
||||||
'--format', 'codeframe',
|
|
||||||
'--ext', 'js',
|
|
||||||
'.',
|
'.',
|
||||||
];
|
];
|
||||||
promises.push(new Promise((resolve, reject) => {
|
promises.push(new Promise((resolve, reject) => {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import {inspect} from 'util';
|
||||||
import ESLintPlugin from 'eslint-webpack-plugin';
|
import ESLintPlugin from 'eslint-webpack-plugin';
|
||||||
import webpack from 'webpack';
|
import webpack from 'webpack';
|
||||||
|
|
||||||
import eslintConfigFn from './build/default.eslint.config';
|
|
||||||
import commands from './commands';
|
import commands from './commands';
|
||||||
|
import R from '../require';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
FLECKS_CORE_ROOT = process.cwd(),
|
FLECKS_CORE_ROOT = process.cwd(),
|
||||||
|
@ -43,7 +43,8 @@ export const hooks = {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (exclude.includes(target)) {
|
if (!exclude.includes(target)) {
|
||||||
|
const eslintConfigFn = R(flecks.buildConfig('default.eslint.config.js', target));
|
||||||
const eslint = eslintConfigFn(flecks);
|
const eslint = eslintConfigFn(flecks);
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new ESLintPlugin({
|
new ESLintPlugin({
|
||||||
|
@ -55,9 +56,9 @@ export const hooks = {
|
||||||
overrideConfig: {
|
overrideConfig: {
|
||||||
...eslint,
|
...eslint,
|
||||||
settings: {
|
settings: {
|
||||||
...(eslint.settings || {}),
|
...eslint.settings,
|
||||||
'import/resolver': {
|
'import/resolver': {
|
||||||
...(eslint.settings['import/resolver'] || {}),
|
...eslint.settings['import/resolver'],
|
||||||
webpack: {
|
webpack: {
|
||||||
config: {
|
config: {
|
||||||
resolve: config.resolve,
|
resolve: config.resolve,
|
||||||
|
@ -76,8 +77,8 @@ export const hooks = {
|
||||||
*/
|
*/
|
||||||
'babel.config.js',
|
'babel.config.js',
|
||||||
/**
|
/**
|
||||||
* ESLint defaults. The default `eslint.config.js` just reads from this file so that the build
|
* ESLint defaults. The generated `eslint.config.js` just reads from this file so that the
|
||||||
* process can dynamically configure parts of ESLint.
|
* build can dynamically configure parts of ESLint.
|
||||||
*/
|
*/
|
||||||
'default.eslint.config.js',
|
'default.eslint.config.js',
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user