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 and ESLint #5

Closed
mkartchner994 opened this issue Dec 18, 2017 · 4 comments
Closed

Add Prettier and ESLint #5

mkartchner994 opened this issue Dec 18, 2017 · 4 comments

Comments

@mkartchner994
Copy link
Contributor

Would be nice to add Prettier and ESLint to the project.
https://prettier.io/
https://eslint.org/

@arthurdenner
Copy link
Contributor

I was missing this while doing #17. Since we're using kcd-scripts, could we only extend its configuration and change what we want? I've used it once and the only thing I changed was the Prettier configuration because I only like to override "singleQuote": true and "trailingComma": "es5". The default overrides are:

semi: false,
singleQuote: true,
trailingComma: 'all',
bracketSpacing: false,

@mkartchner994
Copy link
Contributor Author

I like this idea. This is the only thing I have used kcd-scripts for so I am not as familiar on how to get it set up. I am open to any suggestions for how to do so. Thanks!

@arthurdenner
Copy link
Contributor

I think the main point is to decide which Prettier options to follow. kcd-scripts has some overrides that we can use or create our own.

About ESLint, you can add the following on package.json and be good to go:

"eslintConfig": {
    "extends": "./node_modules/kcd-scripts/eslint.js",
    "rules": {
    // overrides rules if you want
    }
  },
  "eslintIgnore": [
    "node_modules",
    // ignore whatever you want
],

I'd suggest to add two scripts on package.json too:

"lint": "kcd-scripts lint", // checks for ESLint errors
"precommit": "kcd-scripts precommit", // format the code accordingly to the rules you setup before commiting

@mkartchner994
Copy link
Contributor Author

This has been merged to master in this PR - #19. I will look at releasing a new version to npm soon, as this updated some of the internals for some date calculations.

Thanks again @arthurdenner!

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

No branches or pull requests

2 participants