Skip to content

Commit

Permalink
fix(eslint-config): remove isSrcDirAvailable from resolvePaths
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Nov 1, 2019
1 parent 3715f24 commit aa218d2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions packages/eslint-config/_util.js
Expand Up @@ -48,10 +48,6 @@ if (exports.isMonorepo) {
}, [])
}

try {
exports.isSrcDirAvailable = fs.statSync(resolve('src')).isDirectory()
} catch (e) {}

exports.isWebpackAvailable = isPkgAvailable('webpack')

// https://webpack.js.org/api/module-variables/#__resourcequery-webpack-specific
Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-config/index.js
Expand Up @@ -3,7 +3,6 @@ const { getGlobals } = require('eslint-plugin-mdx')
const {
allowModules,
camelCaseRule,
isSrcDirAvailable,
isWebpackAvailable,
magicNumbers,
webpackSpecVars,
Expand All @@ -24,7 +23,6 @@ module.exports = {
settings: {
node: {
allowModules,
resolvePaths: isSrcDirAvailable ? 'src' : undefined,
tryExtensions: [
'.ts',
'.tsx',
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-config/overrides.js
Expand Up @@ -10,7 +10,7 @@ const {
tryPkg,
} = require('@pkgr/utils')

const { camelCaseRule, isSrcDirAvailable, magicNumbers } = require('./_util')
const { camelCaseRule, magicNumbers } = require('./_util')

const configFile =
tryFile(resolve('babel.config.js')) ||
Expand Down Expand Up @@ -70,7 +70,6 @@ const resolveSettings = {
resolvePaths: [
tryFile('node_modules/@d-ts', true),
tryFile('node_modules/@types', true),
isSrcDirAvailable && 'src',
].filter(Boolean),
tryExtensions: [
'.ts',
Expand Down

0 comments on commit aa218d2

Please sign in to comment.