Comments (8)
It should not trigger any linting rule. It is a simple statement. Same as if you were to call a function - you are not expected to assign it to anything. Do you have a specific ESLint rule in mind?
"use strict" is not a directive on itself either. It is a regular statement just like the former. What makes it a directive is that ES engine seeks out for it. Another example is "use strong".
I don't hold strong opinion about this, but introducing a breaking change just for code style reasons is not a good way to maintain a library.
Finally, the only argument that I can think of against this approach is that code minifiers will not remove "create index" statement. But the negligible performance and size implications make this of no difference.
Thoughts?
On Mar 1, 2016, at 22:20, Levi Thomason [email protected] wrote:
Currently, create-index files are identified by the string:
'create index';
This string is not linter friendly since it is not an assignment nor call. As far as know, there is no way to define new directives like 'use strict`.What about using a comment like eslint, flow type, and others:
/* create-index */
or/* @create-index */
The latter would give a little more certainty when parsing comments for the flag. A flag like this would also allow parsing options following the flag as with eslint for instance.Thoughts?
—
Reply to this email directly or view it on GitHub.
from create-index.
Looks like the directive lint rule was a red herring actually. Though I'm realizing linter issues are further reaching than originally thought. Use of semicolons throws in our code bases for instance. We could ignore all index files, but that would exclude manually created index files from linting which is not good either.
Immediate solutions that come to mind are convoluted, but include things like config options or a template file so you could add your own /* eslint-disable */
rules or something.
Ideas on how to have some level of control over what gets generated?
from create-index.
Will think about it overnight.
On Mar 1, 2016, at 23:43, Levi Thomason [email protected] wrote:
Looks like the directive lint rule was a red herring actually. Though I'm realizing linter issues are further reaching than originally thought. Use of semicolons throws in our code bases for instance. We could ignore all index files, but that would exclude manually created index files from linting which is not good either.
Immediate solutions that come to mind are convoluted, but include things like config options or a template file so you could add your own /* eslint-disable */ rules or something.
Ideas on how to have some level of control over what gets generated?
—
Reply to this email directly or view it on GitHub.
from create-index.
@levithomason I don't think that configuring output is an option. It makes little sense to be concerned with generated code style. What about adding:
/* eslint-disable */
/* jshint ignore:start */
to the top of generated file?
from create-index.
That would solve any potential linter issues and seems like a good iteration to me.
from create-index.
Do you still want to create a separate issue for the original issue? The identifier.
from create-index.
I think the lint ignore captures the intent.
from create-index.
Use // @create-index
to target files.
from create-index.
Related Issues (20)
- Feature request: Excluding specific files HOT 4
- README uses previous export syntax example HOT 1
- There is no check if the imported file has a default. HOT 2
- Add option to uppercase first char of export HOT 4
- Recursive option when using programmatically HOT 1
- Functions exported as default not picked up
- Include folder name in banner
- Importing created subdirectory index files HOT 5
- JSX Files HOT 2
- Add --output option to configure output file HOT 3
- Files with hyphen are ignored. HOT 1
- option to "disable" semicolon HOT 2
- implementation with .ts file maybe?
- [bug] can't read file or folder with "-"? HOT 5
- Tests don't work? HOT 2
- 'create-index' is not recognized as an internal or external command, operable program or batch file HOT 1
- Support creating index with default export HOT 9
- Use with typescript, add webpack plugin HOT 2
- Wrong casing in generated index.js
- Conflicts between files and folders with same name
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 create-index.