-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update react-scripts * chore: rebuild lock file * chore: ensure react plugin is only loaded once * chore: ignore import extension rule * chore: remove unnecessary eslint disable * refactor: move extends and ignorepatterns
- Loading branch information
Showing
5 changed files
with
4,347 additions
and
4,239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const eslintRunningLocally = process.cwd() === __dirname | ||
// This should only exist when in development! | ||
const rootConfigPath = path.resolve(__dirname, '../.eslintrc.js') | ||
|
||
const delegateEslintConfig = path.resolve(__dirname, '../.eslintrc.js') // This should only exist when in development! | ||
const shouldDelegate = | ||
!eslintRunningLocally && fs.existsSync(delegateEslintConfig) | ||
const isRunningHere = process.cwd() === __dirname | ||
const hasRootConfig = fs.existsSync(rootConfigPath) | ||
const isDevelopment = !isRunningHere && hasRootConfig | ||
|
||
const extendsList = shouldDelegate | ||
? [delegateEslintConfig, 'react-app'] | ||
: 'react-app' | ||
module.exports = { | ||
ignorePatterns: shouldDelegate ? [] : ['src/D2App/*'], | ||
extends: extendsList, | ||
// Ignore app code that the dev has no control over | ||
ignorePatterns: isDevelopment ? [] : ['src/D2App/*'], | ||
// Use local config for developing this library, react-app preset for linting app code | ||
extends: isDevelopment ? rootConfigPath : 'react-app', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.