Skip to content

Remove react config #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions bin/eslint-github-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const path = require('path')
const defaults = {
project: 'lib',
env: 'browser',
typeSystem: 'none',
react: true,
relay: true
typeSystem: 'none'
}

const packagePath = path.resolve(process.cwd(), 'package.json')
Expand All @@ -20,9 +18,6 @@ if (fs.existsSync(packagePath)) {
const dependencies = Object.keys(packageJSON.dependencies || {})
const devDependencies = Object.keys(packageJSON.devDependencies || {})

defaults.react = dependencies.includes('react') || devDependencies.includes('react')
defaults.relay = dependencies.includes('relay') || devDependencies.includes('relay')

if (dependencies.includes('flow-bin') || devDependencies.includes('flow-bin')) {
defaults.typeSystem = 'flow'
}
Expand Down Expand Up @@ -52,19 +47,6 @@ const questions = [
message: 'What type system are you using?',
choices: ['flow', 'typescript', 'none'],
default: defaults.typeSystem
},
{
type: 'confirm',
name: 'relay',
message: 'Are you using Relay?',
default: defaults.relay
},
{
type: 'confirm',
name: 'react',
message: 'Are you using React?',
default: defaults.react,
when: answers => answers.env === 'browser'
}
]

Expand Down Expand Up @@ -96,16 +78,10 @@ inquirer.prompt(questions).then(answers => {
moduleResolution: 'node'
}
}
if (answers.react) {
tsconfigDefaults.compilerOptions.jsx = 'react'
}
fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfigDefaults, null, ' '), 'utf8')
}
}

if (answers.react) eslintrc.extends.push('plugin:github/react')
if (answers.relay) eslintrc.extends.push('plugin:github/relay')

fs.writeFileSync(path.resolve(process.cwd(), '.eslintrc.json'), JSON.stringify(eslintrc, null, ' '), 'utf8')

const prettierConfig = []
Expand Down
8 changes: 0 additions & 8 deletions docs/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ Recommended rules when using Babel to transpile features from ES2015+.

Recommended rules for projects using the [Flow type checker](https://flow.org/).

### `plugin:github/react`

Recommended rules for projects using [React](https://reactjs.org/).

### `plugin:github/relay`

Recommended rules for projects using [Relay](http://facebook.github.io/relay/) (and React).

### `plugin:github/app`

Recommended rules when writing a browser application.
Expand Down
136 changes: 0 additions & 136 deletions lib/configs/react.js

This file was deleted.

13 changes: 0 additions & 13 deletions lib/configs/relay.js

This file was deleted.

2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ module.exports = {
es6: require('./configs/es6'),
flow: require('./configs/flow'),
node: require('./configs/node'),
react: require('./configs/react'),
recommended: require('./configs/recommended'),
relay: require('./configs/relay'),
typescript: require('./configs/typescript')
}
}
Loading