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

Update build process for ES6 #320

Merged
merged 10 commits into from
Jan 12, 2017
Merged

Update build process for ES6 #320

merged 10 commits into from
Jan 12, 2017

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Jan 11, 2017

  • Make npm run build run npm compile (it needs the output)
  • Switch to ESlint so we can actually use ES6 without the linter
    crying.

 * Make npm run build run npm compile (it needs the output)
 * Switch to ESlint so we can actually use ES6 without the linter
   crying.
@@ -7,12 +7,12 @@
"test": "istanbul cover --report cobertura --config .istanbul.yml -i \"lib/**/*.js\" jasmine-node -- spec --verbose --junitreport --captureExceptions",
"check": "jasmine-node spec --verbose --junitreport --captureExceptions",
"gendoc": "jsdoc -r lib -P package.json -R README.md -d .jsdoc",
"compile": "babel -s -d lib src",
"compile": "npm run lint && babel -s -d lib src",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to maintain a separate compile target? why not just stick it into build ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wfm

ignoreComments: true,
}],
curly: ["error", "multi-line"],
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we enable http://eslint.org/docs/rules/require-jsdoc and http://eslint.org/docs/rules/valid-jsdoc? It would be a shame if we started slipping into bad habits with the jsdoc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly, turning these on produces 537 warnings, so presumably it's somewhat stricter than jshint :/

Should we turn them on and aspire to fix the warnings?

@richvdh richvdh assigned dbkr and unassigned richvdh Jan 11, 2017
@dbkr
Copy link
Member Author

dbkr commented Jan 12, 2017

ptal

"dist": "npm run build",
"watch": "watchify --exclude olm browser-index.js -o dist/browser-matrix-dev.js -v",
"lint": "jshint -c .jshint src spec && gjslint --unix_mode --disable 0131,0211,0200,0222,0212 --max_line_length 90 -r spec/ -r src/",
"lint": "eslint src",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we check the spec folder too? we used to, and jenkins.sh apparently does.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we set --max-warnings on this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed (and max-warnings now redundant since everything is an error)

ignoreComments: true,
}],
curly: ["error", "multi-line"],
"require-jsdoc": ["warn", {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these warnings rather than errors?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

"dist": "npm run build",
"watch": "watchify --exclude olm browser-index.js -o dist/browser-matrix-dev.js -v",
"lint": "jshint -c .jshint src spec && gjslint --unix_mode --disable 0131,0211,0200,0222,0212 --max_line_length 90 -r spec/ -r src/",
"lint": "eslint src",
"prepublish": "npm run compile && git rev-parse HEAD > git-revision.txt"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/compile/build/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

and make everything errors, so now you can do local builds with
lint failures, but CI will fail and you can't release.
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to enable some rules for this to be useful.

https://github.com/google/eslint-config-google looks useful, given we purport to follow the google style.

Remove some we don't care about. Set some other ones we do care
about but don't currently adhere to to warn. Set the max warnings
threshold to the current number of warnings, so we don't introduce
more of them. Fix a bunch of legit lint errors and add exceptions
to various places in the test code that does funny things with
'this'.
Turn off / tweak some options from it. Fix a double-definition.
Add an eslint config to the spec directory to tell it about the
jasmine magic globals.
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dbkr dbkr merged commit d8c23c0 into develop Jan 12, 2017
@t3chguy t3chguy deleted the dbkr/build_process_es6 branch May 10, 2022 14:01
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

Successfully merging this pull request may close these issues.

2 participants