-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
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
Sniffer for other file extensions #109
Comments
Do your CSS and JS files have PHP in them? I don't think phpcs or phpcbf has any concept of scanning non-PHP files. |
@valeryan |
Do you have a document source for what you are talking about? I don't see anything in the documentation for PHPcs doing anything for css or js. I feel like you may be confused about what this extension does. It's not a general sniffer it's a wrapper for phpcs and phpcbf |
@valeryan |
I can look into it but ultimately this is a php tool and the concept of using it for css or js is weird to me and I think it would be better to use something specialized in those file types like prettier and eslint. |
Some projects have their own standards for any file type |
Yeah, but PHPcs does not lint the files it just passes the standards definitions to another tool such as csslint. https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-path-to-csslint That will require some development of new configuration, detection and tooling to support. If one of the other maintainers wants to pick up and support this it might get added. Currently I am not looking to do more than maintain this extension with bug or security fixes. |
@valeryan I currently resolved that with the extension: phpSniffer.extraFiles: Glob patterns of extra files to match that this extension should run on. Useful for standards that don't just validate PHP files. This extension will always run on PHP files — be sure to have your files.associations setting correctly setup for PHP files. |
I am familiar with wongjin's extension. I went and found where the generic files support was added. here is the commit for reference: wongjn/vscode-php-sniffer@89ddc08. We should be able to adapt the concept into this extension but I can't give you anything close to a timeline. |
@valeryan it's worth noting that PHPCS has deprecated and will eventually drop support for any JS and CSS sniffs. Relevant links
Therefore it's probably not worth adding support for something that will not be supported in newer PHPCS versions. |
@jonathanbossenger thanks for researching that for us. Given that the feature is on the way out/gone I am closing this. |
Hi,
How can I enable sniffer for other file extensions?
like CSS and JS files?
Thank you
The text was updated successfully, but these errors were encountered: