Comments (6)
As of now there is no way to do this.
I could add some code that would check if the file starts with
/**
* @jsx React.DOM
*/
and only run the file trought the transformer if this is the case.
Would that be a possible solution?
Or it could check if the file has a .jsx
file extension.
from grunt-jsxhint.
We're not fans of adding that comment at the top, as our internal naming convention of keeping the .jsx
extension is enough for us to determine if it needs transforming.
If there was a split code path based on the file extension that would fit our use case perfectly. I haven't been working with jsx long enough to know any other use cases yet.
from grunt-jsxhint.
ok. I will add the split code path based on the file extension.
from grunt-jsxhint.
Awesome!
from grunt-jsxhint.
I added the check for the file extension. Now only .jsx
files run through the transformer. I published the package to npm.
from grunt-jsxhint.
Thanks. I'll update when I get back at work in the morning :)
from grunt-jsxhint.
Related Issues (18)
- Add test cases
- Use locally installed react-tools HOT 4
- Unclear how to use HOT 1
- Support files with extension .react.js HOT 1
- Add config option for custom file suffixes HOT 1
- Ignore transformed JSX -> JS code HOT 3
- Update React tools to 0.12.2 HOT 2
- Add linting
- Use ES6 syntax - passtough harmony setting to react-tools HOT 6
- jsxhint does not seem to be working HOT 1
- List `react-tools` as a real dependency (not devDependencies) HOT 3
- Babel option HOT 5
- node 6.1.0
- update rewire HOT 1
- warning with object destructuring rest properties
- Not parsing ES6
- option for still supporting *.js ? HOT 3
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 grunt-jsxhint.