-
Notifications
You must be signed in to change notification settings - Fork 141
Organize config options #1042
Organize config options #1042
Changes from 15 commits
9826f5c
57ceb39
81aea68
6130412
11ceb0d
7e8b0f5
27631af
3f12099
2088026
da1ac1a
03a7979
73ea71b
398ecb9
fdb5de9
554ca65
49b695c
4aa80d7
ccb881e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,72 +9,6 @@ | |
"atom": ">=1.13.0 <2.0.0" | ||
}, | ||
"configSchema": { | ||
"lintHtmlFiles": { | ||
"title": "Lint HTML Files", | ||
"description": "You should also add `eslint-plugin-html` to your .eslintrc plugins", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"useGlobalEslint": { | ||
"title": "Use global ESLint installation", | ||
"description": "Make sure you have it in your $PATH", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"showRuleIdInMessage": { | ||
"title": "Show Rule ID in Messages", | ||
"type": "boolean", | ||
"default": true | ||
}, | ||
"disableWhenNoEslintConfig": { | ||
"title": "Disable when no ESLint config is found (in package.json or .eslintrc)", | ||
"type": "boolean", | ||
"default": true | ||
}, | ||
"eslintrcPath": { | ||
"title": ".eslintrc Path", | ||
"description": "It will only be used when there's no config file in project", | ||
"type": "string", | ||
"default": "" | ||
}, | ||
"globalNodePath": { | ||
"title": "Global Node Installation Path", | ||
"description": "Write the value of `npm get prefix` here", | ||
"type": "string", | ||
"default": "" | ||
}, | ||
"advancedLocalNodeModules": { | ||
"title": "Path to the local node_modules folder", | ||
"description": "Optionally specify the path to the local node_modules folder", | ||
"type": "string", | ||
"default": "" | ||
}, | ||
"eslintRulesDirs": { | ||
"title": "ESLint Rules Directories", | ||
"description": "Specify a comma separated list of directories for ESLint to load rules from.", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"disableEslintIgnore": { | ||
"title": "Don't use .eslintignore files", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"disableFSCache": { | ||
"title": "Disable FileSystem Cache", | ||
"description": "Paths of node_modules, .eslintignore and others are cached", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"fixOnSave": { | ||
"title": "Fix errors on save", | ||
"description": "Have eslint attempt to fix some errors automatically when saving the file.", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"scopes": { | ||
"title": "List of scopes to run ESLint on, run `Editor: Log Cursor Scope` to determine the scopes for a file.", | ||
"type": "array", | ||
|
@@ -87,31 +21,140 @@ | |
], | ||
"items": { | ||
"type": "string" | ||
}, | ||
"order": 1 | ||
}, | ||
"lintHtmlFiles": { | ||
"title": "Lint HTML Files", | ||
"description": "You should also add `eslint-plugin-html` to your .eslintrc plugins", | ||
"type": "boolean", | ||
"default": false, | ||
"order": 2 | ||
}, | ||
"autofix": { | ||
"type": "object", | ||
"order": 3, | ||
"title": "Automatic Fixes", | ||
"properties": { | ||
"fixOnSave": { | ||
"title": "Fix errors on save", | ||
"description": "Have eslint attempt to fix some errors automatically when saving the file.", | ||
"type": "boolean", | ||
"default": false, | ||
"order": 1 | ||
}, | ||
"ignoreFixableRulesWhileTyping": { | ||
"title": "Ignore fixable rules while typing", | ||
"description": "Have the linter ignore all fixable rules during linting when editing a document. The list is automatically updated on each lint job, and requires at least one run to be populated. Only supported when using ESLint v4+.", | ||
"type": "boolean", | ||
"default": false, | ||
"order": 2 | ||
}, | ||
"rulesToDisableWhileFixing": { | ||
"title": "Disable specific rules from fixes", | ||
"description": "Prevent rules from being auto-fixed by ESLint. Applies to fixes made during saves as well as when running the `Linter Eslint: Fix File` command.", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"type": "string" | ||
}, | ||
"order": 3 | ||
} | ||
} | ||
}, | ||
"rulesToSilenceWhileTyping": { | ||
"title": "Silence specific rules while typing", | ||
"description": "Useful when Atom fixes errors on save like `no-trailing-spaces` or `eol-last`.", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"type": "string" | ||
"global": { | ||
"type": "object", | ||
"order": 4, | ||
"title": "Global ESLint", | ||
"properties": { | ||
"useGlobalEslint": { | ||
"title": "Use global ESLint installation", | ||
"description": "Make sure you have it in your $PATH", | ||
"type": "boolean", | ||
"default": false, | ||
"order": 1 | ||
}, | ||
"eslintrcPath": { | ||
"title": ".eslintrc Path", | ||
"description": "It will only be used when there's no config file in project", | ||
"type": "string", | ||
"default": "", | ||
"order": 4 | ||
}, | ||
"globalNodePath": { | ||
"title": "Global Node Installation Path", | ||
"description": "Write the value of `npm get prefix` here", | ||
"type": "string", | ||
"default": "", | ||
"order": 2 | ||
} | ||
} | ||
}, | ||
"rulesToDisableWhileFixing": { | ||
"title": "Disable specific rules from fixes", | ||
"description": "Prevent rules from being auto-fixed by ESLint. Applies to fixes made during saves as well as when running the `Linter Eslint: Fix File` command.", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"type": "string" | ||
"disabling": { | ||
"type": "object", | ||
"order": 5, | ||
"properties": { | ||
"disableWhenNoEslintConfig": { | ||
"title": "Disable when no ESLint config is found (in package.json or .eslintrc)", | ||
"type": "boolean", | ||
"default": true, | ||
"order": 1 | ||
}, | ||
"rulesToSilenceWhileTyping": { | ||
"title": "Silence specific rules while typing", | ||
"description": "Useful when Atom fixes errors on save like `no-trailing-spaces` or `eol-last`.", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"type": "string" | ||
}, | ||
"order": 2 | ||
} | ||
} | ||
}, | ||
"ignoreFixableRulesWhileTyping": { | ||
"title": "Ignore fixable rules while typing", | ||
"description": "Have the linter ignore all fixable rules during linting when editing a document. The list is automatically updated on each lint job, and requires at least one run to be populated. Only supported when using ESLint v4+.", | ||
"type": "boolean", | ||
"default": false | ||
"advanced": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add a Although it doesn't seem to be documented, it's tested in the specs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filed atom/atom#16030 about getting it officially documented 😉. |
||
"type": "object", | ||
"collapsed": true, | ||
"title": "Uncommon", | ||
"order": 6, | ||
"properties": { | ||
"disableEslintIgnore": { | ||
"title": "Don't use .eslintignore files", | ||
"type": "boolean", | ||
"default": false, | ||
"order": 1 | ||
}, | ||
"disableFSCache": { | ||
"title": "Disable FileSystem Cache", | ||
"description": "Paths of node_modules, .eslintignore and others are normally cached", | ||
"type": "boolean", | ||
"default": false, | ||
"order": 2 | ||
}, | ||
"showRuleIdInMessage": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗒 One could make the argument this should go in the "general uncategorized" area, but I think it's fine leaving this down here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really understand why someone would want to turn that off. Do you know off-hand the reason for the option to exist at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would make the output cleaner and easier to read at the cost of being much harder to look up rules in the docs or write inline disable rules. I would never turn this off, but I can see the motivation. I think it's reasonable to argue for removing it entirely. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like it was added in 72cc3cb, I was hoping for a bit more context as to why, but no luck. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remember correctly he wanted to remove it completely when doing the rewrite, but I made him keep it around (this was before the rule ID even linked to the relevant page, so it was very helpful for googleing an error). The compromise was an option that defaulted enabled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I said you could argue to remove it, I meant you could remove the setting. Removing the rule id for everybody would be incredibly mean. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh personally I would be for removing the setting, but there are people out there that don't like the "noise". |
||
"title": "Show Rule ID in Messages", | ||
"type": "boolean", | ||
"default": true, | ||
"order": 3 | ||
}, | ||
"eslintRulesDirs": { | ||
"title": "ESLint Rules Directories", | ||
"description": "Specify a comma separated list of directories for ESLint to load rules from.", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"type": "string" | ||
}, | ||
"order": 4 | ||
}, | ||
"advancedLocalNodeModules": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 Since we are already migrating this to a new key, what about renaming it to just |
||
"title": "Path to the local node_modules folder", | ||
"description": "Optionally specify the path to the local node_modules folder", | ||
"type": "string", | ||
"default": "", | ||
"order": 5 | ||
} | ||
} | ||
} | ||
}, | ||
"scripts": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add something here to emphasize that local installation is the suggested usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned to @Arcanemagus in one of the previous comments, I'd like to save wording tweaks for another PR. There is a lot that I would like to do to help explain and clarify our settings, but this PR is really just about reorganizing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. 👍