Skip to content
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

Add Prettier + ESLint Integration #480

Merged
merged 6 commits into from
Jun 8, 2017
Merged

Add Prettier + ESLint Integration #480

merged 6 commits into from
Jun 8, 2017

Conversation

kohlmannj
Copy link

@kohlmannj kohlmannj commented May 3, 2017

fixes #445

This PR adds the following enhancements:

  • kyt-core: add Prettier, eslint-config-prettier, and eslint-plugin-prettier as dependencies
  • eslint-config-kyt: add the above three modules as peer dependencies
  • eslint-config-kyt: update .eslintrc.json to configure Prettier for 100-character line length, single quotes, and ES5-style trailing commas (which I think is the closest approximation of the existing comma-dangle rules)
  • eslint-config-kyt: update Install section of the README to note the additional dependencies

Note: eslint-config-prettier disables ESLint rules that might conflict with Prettier, while eslint-plugin-prettier runs Prettier (and passes it a config) as part of the linting process.

Also, ESLint and its ruleset covers more than just code formatting, so it's appropriate to use both ESLint and Prettier together, rather than replace one with the other.

@kohlmannj
Copy link
Author

I'm not sure what additional dependencies I need to add such that the Travis build will work again. I thought kyt-core was the only place where I needed to add these new dependencies…

@@ -42,6 +44,11 @@
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}],
"prettier/prettier": ["error", {
"printWidth": 100,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"semi": true,

Copy link
Contributor

@staylor staylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add the one rule is eslintrc.json

@delambo delambo merged commit 0c97d82 into nytimes:master Jun 8, 2017
@delambo
Copy link
Member

delambo commented Jun 8, 2017

🙏 @kohlmannj

tizmagik added a commit that referenced this pull request Jun 9, 2017
* master:
  Add Prettier + ESLint Integration (#480)
  Adds 0.6.0 final version (#498)
  adds 060-rc.1 (#497)
  webpack 2.6.1 (#496)
  Adds vendor bundling (#487)
  Adds 0.6.0 alpha (#488)
  chore: webpack & friends dep refresh (#482)

# Conflicts:
#	package.json
#	packages/babel-preset-kyt-core/yarn.lock
#	packages/babel-preset-kyt-react/yarn.lock
#	packages/kyt-cli/yarn.lock
#	packages/kyt-core/package.json
#	packages/kyt-core/yarn.lock
#	packages/kyt-starter-static/starter-src/yarn.lock
#	packages/kyt-starter-universal/starter-src/yarn.lock
#	yarn.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use prettier instead of linting
4 participants