Comments (10)
This is due to us using the Node API's lint()
call on the raw text (to support linting on the fly), instead of a file.
@davidtheclark is there anyway to specify the filename of a block of code so stylelint
will check it against this, or should I file an issue about that over there?
from linter-stylelint.
@Arcanemagus I hadn't run into this need before. May as well file an issue with stylelint. But I can't think of any use-case for this other than text editors figuring out whether to ignore the file??? Can anyone else?
I guess there could be a from
option in the node API for specifying a source file name that should be attributed to the direct code
input string, and if it's in the ignoreFiles
glob it will be ignored.
Isn't another way to handle this to expect the text editor plugins to read the ignoreFiles
glob and determine whether to run stylelint or not?
Or I guess another possibility is that instead of calling stylelint with code
you actually provide it with the filename. It then finds the file, loads the config, checks the ignoreFiles, etc. Or would that slow things down too much? I don't know: wouldn't it only add one fs
call (to get the file)?
from linter-stylelint.
The problem with a file is linting on the fly, we would need to use a temporary file (the helper library makes this simple), I just don't know how involved other files are in the checking process. If linting a file only involves that file, it would be relatively simple to have the helper library copy to a temporary directory and then run on that.
from linter-stylelint.
@Arcanemagus Interesting. Well, stylelint wouldn't need anything other than the file to run. We could look into that option at some point.
from linter-stylelint.
As an FYI, several linters that provide a Node API, and are able to ignore files based on matching a pattern, support specifying the file name for code/stdin... but there are also a few that don't where it has had to be worked around in the provider here.
from linter-stylelint.
@Arcanemagus: Could you point me to some linters that do? I'd like to see what the conventions are.
from linter-stylelint.
@1000ch Do you want to work on moving to the temporary file method?
@davidtheclark eslint
is the first one that pops into mind: http://eslint.org/docs/developer-guide/nodejs-api
from linter-stylelint.
@Arcanemagus: This is a pretty easy addition to stylelint. I will get a PR up before breakfast.
from linter-stylelint.
@paulrobertlloyd This may be resolved in v1.13.0
. Thanks @davidtheclark
from linter-stylelint.
Yup, it works. Fantastic, thank-you!
from linter-stylelint.
Related Issues (20)
- don't fix "color-hex-case": "lower" rule in rgba functinos. HOT 1
- Uncaught Error: Cannot find module 'sb-fs' HOT 2
- Error and stack trace while trying to run stylelint on a file HOT 1
- Uncaught RangeError: path should be a `path.relative()`d string, but got "../../../../duncan/dev/central/web-ui/src/components/common/Component.md" HOT 1
- Don't work with .sass files HOT 2
- EBADF: Bad File Descriptor error HOT 3
- stylelint version way out of date and incompatible with current stylelint rules HOT 4
- How can I get "Possible Errors" to show up as errors and "Stylistic Issues" to show up as warnings? HOT 3
- Provide configfile option from settings?
- Inline and/or manual fix integration? HOT 1
- Crash - Error running stylelint Error: Column start (11) greater than line length (0) for line 8 HOT 1
- stylelint.config.js file is ignored
- Cannot destructure property `isPathValid` of 'undefined' or 'null'. HOT 3
- Plugin not working with stylelint-config-sass-guidelines HOT 2
- Update to latest stylelint HOT 5
- Cannot find module 'atom' (crashes fuzzy-finder)
- Error on line 1 HOT 1
- Dependency Dashboard
- Getting error in Atom about static/index.json? HOT 3
- Stylelint Plugin is not picking up nested syntax configrations
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 linter-stylelint.