-
Notifications
You must be signed in to change notification settings - Fork 468
v2021.5.26 #295
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
v2021.5.26 #295
Conversation
…t warn if parameters and properties are listed in nonascii-order. - jslint - add "globalThis" to default globals.
- ci - continue addng regression tests and improve code-coverage.
- cli - add env var JSLINT_CLI to force-trigger cli in jslint.js
- jslint - fix bug failing to parse unicode "\\u{12345}" - ci - fix ci silently failing in node-v12 and node-v14
- website - add fork-me ribbon.
- jslint - fix (global) functionage missing properties finally and try. - website - add fork-me ribbon. - jslint - remove deadcode warning bad_option_a. - jslint - fix bug failing to parse unicode "\\u{12345}" - ci - fix ci silently failing in node-v12 and node-v14 - jslint - remove deadcode for preaction-binary-".". - cli - add env var JSLINT_CLI to force-trigger cli in jslint.js - jslint - fix bug falsely warning against conditional-chaining-operator "?.". - website - load index.html with example code. - website - merge file report.js into browser.js. - jslint - add new rules unordered_param_a, unordered_property_a, that warn if parameters and properties are listed in nonascii-order. - jslint - add "globalThis" to default globals.
Not sure if this is the right place, but I feel like the Oh and I love the new self contained CLI! |
hi @chrswk, jslint will be shipping with ignore-macros shortly. i eventually want to get rid of most of the directives, and use /* jslint ignore:start */
/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&...
/* jslint ignore:end */
let err = {
statusCode: 404,
// suppress warning unordered_property_a
message: "Not Found", // jslint ignore:line
type: "httpError",
url: "https://www.undefined.com/undefined"
}; would that satisfy your needs? and appreciate knowing the cli helps : ) |
Thank for the input. To be honest, I'm not really a fan of the macros instead of the config flags, but I see why it would be easier in some cases. If that is the "solution", I think I will go through the trouble of reordering all my properties and parameters, even if that's a lot of work. But out of curiosity: What is the reason or expected benefit of having ordered properties/parameters? |
when inspecting/editing large dictionaries/json-objects with > 50 items, scrolling around the editor to find a key becomes troublesome if they're not sorted in some canonical order. you've made me consider maybe adding a new directive in meantime, since jslint is tool-less, you are free to disable (or add) warnings by simply editing https://raw.githubusercontent.com/jslint-org/jslint/v2021.5.26/jslint.js
diff --git a/.a00.js b/.a00.js
index 2b62242..bee1d2a 100644
--- a/.a00.js
+++ b/.a00.js
@@ -2769,9 +2769,9 @@ function parameter_list() {
survey(subparam);
a = b;
b = String(subparam.value || subparam.id);
- if (a > b) {
- warn("unordered_param_a", subparam);
- }
+ //!! if (a > b) {
+ //!! warn("unordered_param_a", subparam);
+ //!! }
advance();
signature.push(subparam.id);
if (next_token.id === ":") {
@@ -3123,9 +3123,9 @@ prefix("{", function () {
advance();
a = b;
b = String(name.value || name.id);
- if (a > b) {
- warn("unordered_property_a", name);
- }
+ //!! if (a > b) {
+ //!! warn("unordered_property_a", name);
+ //!! }
if (
(name.id === "get" || name.id === "set")
&& next_token.identifier
@@ -3284,9 +3284,9 @@ function do_var() {
survey(name);
a = b;
b = String(name.value || name.id);
- if (a > b) {
- warn("unordered_param_a", name);
- }
+ //!! if (a > b) {
+ //!! warn("unordered_param_a", name);
+ //!! }
advance();
if (next_token.id === ":") {
advance(":"); |
new version v2021.5.27 has been pushed to branch also in future, please use https://github.com/jslint-org/jslint/issues to raise issues/feature-requests/ideas ; ) |
Oh no. As a developer who fights every day to not have to add new config parameters for X and Y to my software, I now have a config parameter on my conscience! 😅 I really appreciate your efforts. Your explanation makes sense and I think it should also reduce the mental effort of reasoning about a "logical" order. If you will excuse me, I have some properties and params reordering to do... |
demo of release-candidate available @ https://www.jslint.com/branch.beta/index.html