Add MrDoob Code Style ESLint support #10129

Merged
merged 1 commit into from Nov 15, 2016

Projects

None yet

3 participants

@zz85
Contributor
zz85 commented Nov 15, 2016 edited

Support Mr.doob's Code Style™ linting and autofixing.

How to use

# make sure dependencies are updated
npm install

# Complains about code style errors in src
npm run lint 

# Do autofix (Use with care!)
node_modules/eslint/bin/eslint.js --fix src/[path to file]

Alternatively, eslint is compatible with many editors

image

Relates:

@zz85 zz85 referenced this pull request in zz85/mrdoobapproves Nov 15, 2016
Closed

Simple question... #61

@mrdoob mrdoob merged commit 7fd942d into mrdoob:dev Nov 15, 2016
@mrdoob
Owner
mrdoob commented Nov 15, 2016

Thanks!

@mrdoob
Owner
mrdoob commented Nov 15, 2016

https://github.com/AtomLinter/linter-eslint has this setting:

screen shot 2016-11-15 at 12 27 24

Does this mean that we don't need the .eslintrc file?

@TristanVALCKE
Contributor

Yes you're totally right ! You could add an eslintConfig field in package.json instead of using an .eslintrc separate file ! Take a look here and here, we can see:

eslint [options] file.js [file.js] [dir]

Basic configuration:
  -c, --config path::String    Use configuration from this file or shareable config
  --no-eslintrc                Disable use of configuration from .eslintrc
@zz85 zz85 deleted the zz85:eslint branch Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment