diff --git a/.nova/Configuration.json b/.nova/Configuration.json index 1437e7e..77d6d2b 100644 --- a/.nova/Configuration.json +++ b/.nova/Configuration.json @@ -1,4 +1,4 @@ { - "workspace.name": "ESLint Extension", - "editor.default_syntax": "javascript" + "editor.default_syntax": "javascript", + "workspace.name": "ESLint Extension" } diff --git a/ESLint.novaextension/HELP.md b/ESLint.novaextension/HELP.md new file mode 100644 index 0000000..8adadef --- /dev/null +++ b/ESLint.novaextension/HELP.md @@ -0,0 +1,13 @@ +# Support + +## I don't have eslint installed in the normal place + +This extension looks for eslint in `$WorkspaceRoot/node_modules`. + +If it's not there (e.g., it's installed globally or in a sub-directory), you can configure it's location in your workspace in the `.nova/Configuration.json` file or globally through your extension settings. Make sure your path is properly escaped! + +```json +{ + "Mecham.ESLint.eslintPath" : "\/Volumes\/Macintosh HD\/Users\/cameronlittle\/Dev\/nova-eslint\/ESLint.novaextension\/extension.png" +} +``` diff --git a/Source/Scripts/main.js b/Source/Scripts/main.js index b838f3f..59bd9c4 100644 --- a/Source/Scripts/main.js +++ b/Source/Scripts/main.js @@ -6,7 +6,7 @@ export function activate() { const linter = new Linter(); - nova.commands.register("apexskier.eslint.fix", (editor) => { + nova.commands.register("Mecham.ESLint.fix", (editor) => { if (editor.document.isDirty) { console.log("after saving"); editor.onDidSave(fix); @@ -23,7 +23,7 @@ export function activate() { } }); - nova.commands.register("apexskier.eslint.setPathForWorkspace", () => { + nova.commands.register("Mecham.ESLint.setPathForWorkspace", () => { nova.workspace.showFileChooser( "Choose eslint executable", { @@ -35,14 +35,11 @@ export function activate() { (paths) => { if (paths && paths.length) { nova.workspace.config.set( - "apexskier.eslint.eslintPath", + "Mecham.ESLint.eslintPath", paths[0] ); } else { - nova.workspace.config.set( - "apexskier.eslint.eslintPath", - null - ); + nova.workspace.config.set("Mecham.ESLint.eslintPath", null); } } ); @@ -73,12 +70,12 @@ export function activate() { editor.onWillSave((editor) => { let shouldFix = false; let shouldFixWorkspace = nova.workspace.config.get( - "apexskier.eslint.saveOnFix", + "Mecham.ESLint.saveOnFix", "boolean" ); if (shouldFixWorkspace == null) { shouldFix = nova.config.get( - "apexskier.eslint.saveOnFix", + "Mecham.ESLint.saveOnFix", "boolean" ); } else { diff --git a/Source/Scripts/process.js b/Source/Scripts/process.js index 3f3ebd6..cce1c2d 100644 --- a/Source/Scripts/process.js +++ b/Source/Scripts/process.js @@ -1,7 +1,7 @@ import { eslintOutputToIssue } from "./eslintOutputToIssue"; let eslintPath = `${nova.workspace.path}/node_modules/.bin/eslint`; -nova.workspace.config.onDidChange("apexskier.eslint.eslintPath", (newValue) => { +nova.workspace.config.onDidChange("Mecham.ESLint.eslintPath", (newValue) => { eslintPath = newValue || `${nova.workspace.path}/node_modules/.bin/eslint`; });