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

Add feature to Lint .editorconfig file #236

Merged
merged 8 commits into from
Dec 31, 2019
Merged

Conversation

elarivie
Copy link
Contributor

@elarivie elarivie commented Dec 21, 2019

To make the maintainer's life easier, I...

  • created at least 1 spec to cover my changes,
  • npm tested my code and it's green like an 🍏,
  • adjusted the readme.md, if it was necessary and
  • would like to receive get a 🍺 or ☕ after that hard work!

This pull request adds linting feature when editing .editorconfig file.

fixes #141


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

@elarivie
Copy link
Contributor Author

This is what it looks like in action:

image

lib/lint.js Outdated Show resolved Hide resolved
lib/lint.js Outdated Show resolved Hide resolved
lib/lint.js Outdated Show resolved Hide resolved
@Alhadis
Copy link
Collaborator

Alhadis commented Dec 31, 2019

Personally, I'd avoid making linter a package dependency. Simply providing the service should be enough: if users have linter installed, they'll see messages whilst editing .editorconfig files. Those who don't are greeted with a nag screen at startup asking them to install linter, intentions, linter-ui-default, and busy-signal. For a package that only uses the .editorconfig format indirectly, it's pretty overkill and even a little disruptive.

I recommend the following changes. Do this and we can merge. 👍 Don't forget to regenerate the package-lock.json file (run npm i --package-lock-only to update it manually if you need to).

diff --git a/index.js b/index.js
index 1c85cf4..e182e82 100644
--- a/index.js
+++ b/index.js
@@ -388,8 +388,6 @@ module.exports = {
 			this.disposables.dispose();
 		}
 
-		require('atom-package-deps').install('editorconfig');
-
 		this.disposables = new CompositeDisposable(
 			atom.commands.add('atom-workspace', {
 				'EditorConfig:fix-file': () => {
diff --git a/package.json b/package.json
index 429035e..d420f9c 100644
--- a/package.json
+++ b/package.json
@@ -27,17 +27,12 @@
 	"atomTestRunner": "atom-mocha",
 	"dependencies": {
 		"editorconfig": "^0.15.3",
-		"mapped-disposable": "^1.0.3",
-		"atom-linter": "^10.0.0",
-		"atom-package-deps": "^5.0.0"
+		"mapped-disposable": "^1.0.3"
 	},
 	"devDependencies": {
 		"atom-mocha": "^2.2.0",
 		"xo": "^0.24.0"
 	},
-	"package-deps": [
-		"linter"
-	],
 	"xo": {
 		"globals": [
 			"AtomMocha",

@Alhadis Alhadis merged commit 87777e9 into sindresorhus:master Dec 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notify user about malformed editorconfig-files
2 participants