Skip to content

Commit

Permalink
fix(eslint): do not output warning about react on non-react projects
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurdenner committed Nov 6, 2019
1 parent cf6718c commit 830e413
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/createEslintConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ export function createEslintConfig({
}: CreateEslintConfigArgs): CLIEngine.Options['baseConfig'] {
const isReactLibrary = Boolean(getReactVersion(pkg));

console.log(isReactLibrary);

const config = {
extends: [
'react-app',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
settings: {
react: {
// Fix for https://github.com/jaredpalmer/tsdx/issues/279
version: !isReactLibrary ? '999.999.999' : undefined,
},
},
};

if (writeFile) {
Expand Down

0 comments on commit 830e413

Please sign in to comment.