-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Migrate to ES6 #496
Merged
Merged
Migrate to ES6 #496
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
61906f0
Replace jshint with eslint
forabi d369a39
Migrate to ES6
forabi 5dc5c24
Remove tests from bower ignore (does not exist)
forabi 0ebb3b4
ESLint: ignore builds and tests
forabi 2487421
Restore test for AMD
forabi 95f853b
Restore deprecation message but do not coerce
forabi 9b73512
ESLint: move ignore to .eslintignore
forabi 150667d
ESLint: extends not needed in test dir
forabi 51aaaa9
Tidy up npm scripts
forabi d5d53fe
Update builds
forabi daa442a
Readd comments to browser builds, do not join variables in unminified…
forabi 8aa4a57
Revert version number
forabi 238248a
Add for-in guard
forabi 850286d
Revert depd version
forabi 7832ee3
Remove unnecessary prototype check in toDate
forabi 1a264a0
Revert version number in source
forabi ad5c980
Remove coersion test
forabi c9efde6
Remove depd and all related deprecation code
forabi 760015d
Fix isBefore and isAfter defaulting to Date instance instead of string
forabi 3cdb173
Move util to lib/util (only in builds)
forabi 2a3a92d
disable no console warning in root dir
forabi 81337be
Remove unnecessary ignore rules
forabi 0283443
Remove Makefile from bower.json
forabi bd5e68b
Add explicit dependency "babel-core"
forabi 5197625
ESLint: Add no console warning in src
forabi 11c98c8
Build script: move resolveModuleSource outside waterfall function
forabi e53389a
bower: ignore index, build and package.json
forabi bf9232a
Keep things simple
forabi eaf5088
Specify package files instead of ignored files
forabi e25b884
assertString throw a TypeError
forabi a2c4471
Remove extend documentation from README
forabi 8b84882
Add isMobilePhone validation for ar-SY, isAlpha and isAlphanumeric fo…
forabi 369b753
Lint tests
forabi 95f355c
Add Arabic locales with tests for isAlpha and isAlphanumeric
forabi e44ca88
Update README: Add new Arabic locales
forabi f919358
Prefer template strings
forabi af94fb7
Upgrade to ESLint 2, remove unnecessary deps
forabi b1ff8bc
Remove old ESLint config file
forabi bf16624
Fix ESLint config
forabi be9fb9c
Rebase on 4.9.0
forabi a33b64b
Fix README.md
forabi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
validator.js | ||
validator.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"extends": "airbnb/base", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"node": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"camelcase": [0], | ||
"no-param-reassign": [0], | ||
"one-var": 0, | ||
"one-var-declaration-per-line": 0, | ||
"func-names": 0, | ||
"no-console": 0, | ||
"newline-per-chained-call": 0, | ||
"prefer-const": 0 | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const pkg = require('./package.json'); | ||
const fs = require('fs'); | ||
const rollup = require('rollup').rollup; | ||
const babel = require('rollup-plugin-babel'); | ||
|
||
rollup({ | ||
entry: 'src/index.js', | ||
plugins: [ | ||
babel({ | ||
presets: ['es2015-rollup'], | ||
babelrc: false, | ||
}), | ||
], | ||
}).then(bundle => ( | ||
bundle.write({ | ||
dest: 'validator.js', | ||
format: 'umd', | ||
moduleName: pkg.name, | ||
banner: ( | ||
'/*!\n' + | ||
String(fs.readFileSync('./LICENSE')).trim().split('\n').map(l => ` * ${l}`).join('\n') + | ||
'\n */' | ||
), | ||
}) | ||
)).catch(e => { | ||
process.stderr.write(e.message + '\n'); | ||
process.exit(1); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still work with all of the import schemes defined here? e.g. #448
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chriso I do not use Ember so I'm not sure. Maybe some one can help test it? If it does not work I can open a rollup issue to fix it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is what is causing issues when I tried to switch to es6 modules in an ember app - TryGhost/Admin#34
Please let me know if there is any way I can help resolve the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinansfield the
rollup
package is responsible for generating the output code. There may be a rollup plugin that works for Ember, or a patch to the mainrollup
repo might be required. I'm happy to quickly accept a PR that fixes the problem or updates dependencies. I don't use Ember so cannot test fixes.