Comments (7)
And here is by the way the .jscs.json-config that was used if that helps
{
"excludeFiles": ["frontend/app/bower_components", "frontend/node_modules", "frontend/instrument",
"frontend/dist", "frontend/.tmp", "frontend/coverage",
"backend/node_modules", "backend/coverage"],
"disallowKeywords": ["with"],
"disallowKeywordsInComments": ["TODO"],
"disallowKeywordsOnNewLine": ["else"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpacesInCallExpression": true,
"disallowSpacesInsideParentheses": true,
"maximumLineLength": 120,
"requireBlocksOnNewline": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireDotNotation": "except_snake_case",
"requireLineBreakAfterVariableAssignment": true,
"requireOperatorBeforeLineBreak": true,
"requireParenthesesAroundIIFE": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeKeywords": ["else", "while", "catch"],
"requireSpaceBeforeObjectValues": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInConditionalExpression": true,
"requireSpacesInForStatement": true,
"validateLineBreaks": "LF",
"validateParameterSeparator": ", ",
"validateQuoteMarks": "'"
}
from brackets-jscs.
I have now found that the error is in handleJSXJSCS (Probably in JSXTransformer.transform(text, {harmony: true}).code;)
I added some console output to confirm this
console.log('text', text);
console.log('JSXCode', JSXCode);
return handleJSCS(JSXCode, fullPath, config);
Which gives the output:
text // This line has a trailing space
function a() {
return;
}
JSXCode // This line has a trailing spacefunction a() {
return;
}
My workaround until it is fixed is to change line 189 in main.js to (since I do not use harmony I hope guess that JSXTransformer.transform is not necessary for me):
return handleJSCS(text, fullPath, config);
from brackets-jscs.
Looks like an issue with the JSXTransformer. I have opened a new bug with the Facebook team: facebook/react#3378
from brackets-jscs.
I think it is not JSXTransformer, but this line in handleJSXJSCS:
// Trim trailing whitespace
JSXCode = JSXCode.replace(/( +)\n/g, '');
If I remove it it works better.
Also Node-shebangs ( #!/usr/bin/env node\n ) are not handled correctly. It should be ignored if it is in the beginning of a file. I suggest the following in the beginning of the handleJSXJSCS-function:
text = text.replace(/^#!.+\n/m, '');
from brackets-jscs.
A fix has been pushed for this. Please try v0.2.2 of the extension.
from brackets-jscs.
The first problem is fixed now. But the other one is still a problem, I will create separate issue for that and a pull request.
from brackets-jscs.
Now you have a new problem. The rule:
{"disallowTrailingWhitespace": true}
does not work anymore. I will create a new issue for that.
from brackets-jscs.
Related Issues (20)
- Upgrade to newest JSCS version
- After upgrading to 0.6.0 I get a JSCS processing error HOT 24
- Cannot find module 'jscs' HOT 13
- Unexpectedly stop the node server HOT 2
- JSCS timing out HOT 8
- Plugin breaks when JSCS is used with plugin HOT 1
- The JSCS 2.0 does not use esprima anymore HOT 1
- How to upgrade to JSCS 2.0.0 ? HOT 6
- Configuration file path HOT 1
- Feature request: Add JSCS formatting HOT 1
- Ignored rule: One space required after opening bracket. HOT 5
- Support JSCS v2.2.1 HOT 2
- I'm getting: Unexpected JSCS processing error: Unable to load one of the modules * reason: Cannot find module 'color' HOT 4
- error after latest update: HOT 4
- JSCS issue "Unexpected JSCS processing error: timeout" HOT 2
- Support for the fix parameter HOT 3
- Using multiple brackets windows broke the extension HOT 5
- update to use JSCS 3 HOT 4
- Is there a way to invoke jscs auto fix as part of "save" of a file? HOT 1
- Not clear install instruction HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brackets-jscs.