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

Include eslint for JavaScript linting #70

Open
winsmith opened this issue Aug 24, 2017 · 3 comments
Open

Include eslint for JavaScript linting #70

winsmith opened this issue Aug 24, 2017 · 3 comments

Comments

@winsmith
Copy link
Collaborator

No description provided.

@dunkelstern
Copy link

dunkelstern commented Aug 24, 2017

Working config would be something like this (put into .eslintrc.js):

module.exports = {
 	root: true,
 	parserOptions: {
 		ecmaVersion: 6,
 		sourceType: 'module',
 	},
 	parser: 'babel-eslint',
 	extends: 'airbnb-base',
 	env: {
 		es6: true,
 	},
 	plugins: [
 		'babel',
 	],
 	rules: {
 		'comma-dangle': ['error', 'always-multiline'],
 		'consistent-this': ['error', 'that'],
 		'func-names': 'off',
 		'generator-star-spacing': 'off', // fails with async code at the moment, revisit later
 		'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
 		'indent': ['warn', 'tab', { SwitchCase: 1 }],
 		'max-len': ['error', 120],
 		'new-cap': ['error', { properties: false }],
 		'newline-after-var': 'error',
 		'newline-before-return': 'error',
 		'newline-per-chained-call': ['error', { 'ignoreChainWithDepth': 3 }],
 		'no-comma-dangle': 'off',
 		'no-console': ['error', { allow: ['error', 'log'] }],
 		'no-debugger': 'error',
 		'no-mixed-operators': 'off',
 		'no-multiple-empty-lines': ['error', { 'max': 1, }],
 		'no-param-reassign': 'off',
 		'no-prototype-builtins': 'off',
 		'no-underscore-dangle': 'off',
 		'object-curly-spacing': ['error', 'always'],
 		'prefer-arrow-callback': ['error', { allowNamedFunctions: true, allowUnboundThis: true }],
 		'quote-props': ['error', 'as-needed'],
 		'camelcase': 'off',
 	},
};

This would need the following npm dev-packages:

  • eslint
  • babel-eslint
  • eslint-config-airbnb-base
  • eslint-plugin-babel
  • eslint-plugin-import (though I would not use import but require for now)

If you want to support anything Internet Explorer you would need a pass through babel to un-modernize the js (no arrow-functions there). What's your minimum reqirement?

@winsmith
Copy link
Collaborator Author

Thanks a bunch!

@winsmith winsmith added this to the Live Logging and Updating milestone Aug 29, 2017
@winsmith
Copy link
Collaborator Author

winsmith commented Sep 1, 2017

Regarding IE, I don't reaaally care. This is a developer tool, and I doubt many developers are using IE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants