fix: no longer need to run yarn watch to fix eslint unresolved imports in vs code
This commit is contained in:
parent
22036000a6
commit
db8c309954
|
@ -2,6 +2,11 @@ module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
settings: {
|
settings: {
|
||||||
'import/core-modules': ['electron'],
|
'import/core-modules': ['electron'],
|
||||||
|
'import/resolver': {
|
||||||
|
node: {
|
||||||
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||||
|
},
|
||||||
|
},
|
||||||
react: {
|
react: {
|
||||||
version: 'detect',
|
version: 'detect',
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
const ignoredFiles = ['package.json', 'yarn.lock', 'tsconfig.json', '.lintstagedrc.js'];
|
const ignoredFiles = [
|
||||||
|
'package.json',
|
||||||
|
'yarn.lock',
|
||||||
|
'tsconfig.json',
|
||||||
|
'.lintstagedrc.js',
|
||||||
|
'.eslintrc.js',
|
||||||
|
];
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
@ -15,7 +21,7 @@ const buildLintCommand = filenames => {
|
||||||
.map(f => path.relative(process.cwd(), f))
|
.map(f => path.relative(process.cwd(), f))
|
||||||
.filter(f => !ignoredFiles.includes(f));
|
.filter(f => !ignoredFiles.includes(f));
|
||||||
|
|
||||||
return results.length ? `eslint ${results.join(' ')}`: '';
|
return results.length ? `eslint ${results.join(' ')}` : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in New Issue