We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See https://github.com/outsideris/popularconvention/blob/master/src/parser/js-parser.coffee#L136
onespace = /function(\s+.)*\s+\(/ nospace = /function(\s+.)*\(/
These regex check for function() vs function () without a function name, not for function foo () vs function foo() like advertised.
function()
function ()
function foo ()
function foo()
Either the regex are wrong or the documentation is.
Ideal would be to check for function() vs function () and also for function foo () vs function foo()
Tests:
var onespace = /function(\s+.)*\s+\(/; 'function foo () {'.match(onespace); // => null 'function foo() {'.match(onespace); // => null 'function () {'.match(onespace); // => ["function (", undefined] 'function() {'.match(onespace); // => null var nospace = /function(\s+.)*\(/; 'function foo () {'.match(nospace); // => null 'function foo() {'.match(nospace); // => null 'function () {'.match(nospace); // => null 'function() {'.match(nospace); // => ["function(", undefined]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
See https://github.com/outsideris/popularconvention/blob/master/src/parser/js-parser.coffee#L136
These regex check for
function()
vsfunction ()
without a function name, not forfunction foo ()
vsfunction foo()
like advertised.Either the regex are wrong or the documentation is.
Ideal would be to check for
function()
vsfunction ()
and also forfunction foo ()
vsfunction foo()
Tests:
The text was updated successfully, but these errors were encountered: