fix: eslint

This commit is contained in:
cha0s 2023-12-01 21:41:34 -06:00
parent 329e1b6680
commit 13b7bf465b
3 changed files with 13 additions and 10 deletions

View File

@ -9,6 +9,7 @@ const {join} = require('path');
const D = require('../../debug');
const {default: Flecks} = require('../flecks');
const R = require('../../require');
const debug = D('@flecks/core/server/build/eslint.config.js');
@ -24,7 +25,10 @@ if (FLECKS_CORE_SYNC_FOR_ESLINT) {
debug('bootstrapping flecks...');
const flecks = Flecks.bootstrap();
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);
eslintConfig.settings['import/resolver'].webpack = {
config: {

View File

@ -113,9 +113,7 @@ export default (program, flecks) => {
process.env.FLECKS_CORE_BUILD_TARGET = target;
const cmd = [
'npx', 'eslint',
'--config', flecks.buildConfig('.eslintrc.js', target),
'--format', 'codeframe',
'--ext', 'js',
'--config', flecks.buildConfig('eslint.config.js', target),
'.',
];
promises.push(new Promise((resolve, reject) => {

View File

@ -4,8 +4,8 @@ import {inspect} from 'util';
import ESLintPlugin from 'eslint-webpack-plugin';
import webpack from 'webpack';
import eslintConfigFn from './build/default.eslint.config';
import commands from './commands';
import R from '../require';
const {
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);
config.plugins.push(
new ESLintPlugin({
@ -55,9 +56,9 @@ export const hooks = {
overrideConfig: {
...eslint,
settings: {
...(eslint.settings || {}),
...eslint.settings,
'import/resolver': {
...(eslint.settings['import/resolver'] || {}),
...eslint.settings['import/resolver'],
webpack: {
config: {
resolve: config.resolve,
@ -76,8 +77,8 @@ export const hooks = {
*/
'babel.config.js',
/**
* ESLint defaults. The default `eslint.config.js` just reads from this file so that the build
* process can dynamically configure parts of ESLint.
* ESLint defaults. The generated `eslint.config.js` just reads from this file so that the
* build can dynamically configure parts of ESLint.
*/
'default.eslint.config.js',
/**