-
Notifications
You must be signed in to change notification settings - Fork 898
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
eslint - move to hierarchical configuration #10197
Conversation
currently, we have no `.es6` files and no outstanding PRs introducing ones, and configuring eslint to base rules on file extensions is problematic so dropping this one for now, and we'll reintroduce when we move all *.js files to es6
…/javascripts/ specs will still inherit all the base rules, but additionally allow more spec-specific globals
files under components/, controllers/, directives/ and services/ will get additional angular-related rules applied to them (components/ is currently empty, but won't be for long..)
converted `var foo = {...}; module.exports = { foo: foo }` to `module.exports = { foo: {...} }`
because we no longer need it to be .js
Adding WIP for now, because with the latest,
.. aah, "/home/himdel/manageiq/public/self_service/js/app-a1e38d0e6f.js" .. and node_modules and tmp .. and bower_components.. EDIT: fixed |
to prevent eslint from crashing while trying to lint node_modules, self service bundles, etc
Checked commits https://github.com/himdel/manageiq/compare/d9042ad0813b02019ac2ccdae9ab57b540a43594~...036d4f36b380188ff4228a0c64114cc8236a8894 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
We need to use different linting rules for angular and for specs, though most of it should indeed be shared.
Previously I solved this by running
eslint
4 times, but that means an extra script, and having to merge the resulting JSON in miq-bot .. but eslint supports hierarchical configuration, precisely for those reason .. so this converts our.eslintrc.js
to a bunch of.eslintrc.json
in the right directories..Also removing support for linting
.es6
files for now.. but we don't have any.ManageIQ/miq_bot#221 will depend on this..