Closed DavidLozzi closed 3 years ago
I tested this workaround with 5.6.4:
eslint: {
mode: ESLINT_MODES.extends,
configure: (eslintConfig, { env, paths }) => {
const customESLintConfig = require('./.eslintrc')
return customESLintConfig
}
},
@cdosborn 👍 It's also working with 5.6.4 :
...
const customESLintConfig = require('./.eslintrc');
...
module.exports = {
...
eslint: {
mode: ESLINT_MODES.extends,
configure: () => customESLintConfig,
},
...
};
I changed and use your code because arguments of configure value function are not used and necessery.
Some of the ESLint related package version might conflict with the one came with CRA, which might result in faulty ESLint result, you might want to double-check with the version you have with the one CRA required.
Alternatively, I create a plugin recently to basically replace the CRA eslint-loader(deprecated) with eslint-webpack-plugin, which technically will ignore all the ESLint setup that the CRA has.
Hey @wabi91 and @cdosborn
I'm using "@craco/craco": "5.6.4",
and doing the same as you guys
const customESLintConfig = require("../.eslintrc");
....
module.exports = {
jest: {
collectCoverageFrom: [
"src/**/*.ts",
"src/**/*.tsx",
"!src/serviceWorker.ts",
"!src/setupTests.ts",
"!src/index.tsx",
],
coveragePathIgnorePatterns: ["node_modules", "test-config", "interfaces", "src/@types/**/*.ts", "*.js"],
eslint: {
mode: ESLINT_MODES.extends,
configure: customESLintConfig,
},
...
and seem to be ignoring my rules defined in eslint 😕 is there anything else I need to do?
Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This has been working great for the last couple of years, but we just upgraded a slew of libraries and now eslint, when we run our app, is not referring to our eslintrc file. It's throwing errors for rules that we have either disabled or set to warning. I can type junk into the eslintrc file and nothing errors on build.
The ESLint extension in VSCode does recognize it and running eslint CLI works as expected. When running
npm run start
ornpm run deploy-build
, it seems to ignore the eslintrc file..eslintrc.js
removed many rules for brevitycraco-config.js
local
environmentpackage.json
I suspect there's a library above I have to update but I'm not sure what else to update!