Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Add support for other extensions #63

Closed
OmgImAlexis opened this issue Mar 5, 2017 · 5 comments
Closed

Add support for other extensions #63

OmgImAlexis opened this issue Mar 5, 2017 · 5 comments
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted

Comments

@OmgImAlexis
Copy link

OmgImAlexis commented Mar 5, 2017

Issuehunt badges

Right now the cli works fine with plugins and extensions. When adding for example the vue plugin I've updated my package.json with this and xo finds the issues. Yet when I open Atom I get no linter issues showing up at all.

        "plugins": [
            "vue"
        ],
        "extensions": [
            "vue"
        ]

I'm guessing this is what's causing the issue.

const SUPPORTED_SCOPES = [
	'source.js',
	'source.jsx',
	'source.js.jsx',
	'source.js.embedded.html'
];

IssueHunt Summary

Sponsors (Total: $40.00)

Become a sponsor now!

Or submit a pull request to get the deposits!

Tips

@sindresorhus
Copy link
Owner

Correct. I think we need a mapping between known file extensions and Atom scopes, and then check whether the user added any of the supported scopes from the "extensions" option and then add it to SUPPORTED_SCOPES. Could also take a look at how for example atom-linter-eslint solves this.

@marionebl
Copy link
Contributor

If I unterstand linter-eslint/src/main.js#L75 correctly this is delegated to user configuration completely?

@Arcanemagus
Copy link

@marionebl Correct, the list of scopes that linter-eslint tells linter it should run on is determined entirely from the user config since we have no way of knowing all the possibilities that are out there with ESLint processors.

The known supported scripts are set as the default in the settings, users can add more if they want.

You can also find an alternative approach in use for the lintHtmlFiles setting: If that setting is enabled we add the embedded HTML scope to the current list (whatever it may be), and remove it on disabling of the setting. (here)

Hope that helps!

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label Jun 9, 2019
@IssueHuntBot
Copy link

@issuehunt has funded $40.00 to this issue.


@sindresorhus
Copy link
Owner

Closing as Atom is abandoned.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted
Projects
None yet
Development

No branches or pull requests

5 participants