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

eslint - move to hierarchical configuration #10197

Merged
merged 8 commits into from
Aug 4, 2016
Merged

eslint - move to hierarchical configuration #10197

merged 8 commits into from
Aug 4, 2016

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Aug 2, 2016

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..

himdel added 7 commits August 2, 2016 12:56
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
@himdel
Copy link
Contributor Author

himdel commented Aug 2, 2016

Adding WIP for now, because with the latest,

$ ./node_modules/.bin/eslint .

<--- Last few GCs --->

  253501 ms: Mark-sweep 1317.4 (1434.4) -> 1315.0 (1434.4) MB, 1295.8 / 0 ms [allocation failure] [GC in old space requested].
  254801 ms: Mark-sweep 1315.0 (1434.4) -> 1314.8 (1434.4) MB, 1299.8 / 0 ms [allocation failure] [GC in old space requested].
  256139 ms: Mark-sweep 1314.8 (1434.4) -> 1314.7 (1434.4) MB, 1338.2 / 0 ms [last resort gc].
  257528 ms: Mark-sweep 1314.7 (1434.4) -> 1314.4 (1434.4) MB, 1388.5 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1d1976bc9fa9 <JS Object>
    1: flattenUnusedSegments(aka flattenUnusedSegments) [/home/himdel/manageiq/node_modules/eslint/lib/code-path-analysis/code-path-segment.js:~24] [pc=0x23fd386b4bca] (this=0x1d1976b04189 <undefined>,segments=0x24aa5c0f2c79 <JS Array[1]>)
    2: /* anonymous */(aka /* anonymous */) [/home/himdel/manageiq/node_modules/eslint/lib/code-path-analysis/code-path-segment.js:~177] [pc=0x23fd38576373] ...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Aborted

.. aah, "/home/himdel/manageiq/public/self_service/js/app-a1e38d0e6f.js" .. and node_modules and tmp .. and bower_components..

EDIT: fixed

@himdel himdel changed the title eslint - move to hierarchical configuration [WIP] eslint - move to hierarchical configuration Aug 2, 2016
to prevent eslint from crashing while trying to lint node_modules, self service bundles, etc
@himdel himdel removed the wip label Aug 2, 2016
@himdel himdel changed the title [WIP] eslint - move to hierarchical configuration eslint - move to hierarchical configuration Aug 2, 2016
@miq-bot
Copy link
Member

miq-bot commented Aug 2, 2016

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
0 files checked, 0 offenses detected
Everything looks good. 🍪

@martinpovolny martinpovolny merged commit 6218676 into ManageIQ:master Aug 4, 2016
@martinpovolny martinpovolny added this to the Sprint 45 Ending Aug 22, 2016 milestone Aug 4, 2016
@himdel himdel deleted the eslint-hierarchy branch August 4, 2016 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants