Commit Graph

55 Commits

Author SHA1 Message Date
Thomas Lamprecht
be7da736f9 bump version to 8.3.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-12-01 13:44:44 +01:00
Thomas Lamprecht
4900068a79 fixup! import 8.3.0 source 2021-12-01 13:44:30 +01:00
Thomas Lamprecht
86d4afdb4b commit build of 8.3.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-12-01 13:44:18 +01:00
Thomas Lamprecht
609c276fc2 import 8.3.0 source
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-12-01 13:39:06 +01:00
Thomas Lamprecht
16b19c7b65 build upstream to umd
as we want to avoid requiring npm et al for every build, this is also
effectively vendoring all in, so easier to avoid supply-chain attacks

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-08-30 12:54:34 +02:00
Dominik Csapak
aa1e5f5ecd use worker_threads for linting
instead linting all files in the main thread, use worker threads
for that (4 by default) and add the '-t' switch to able to control that

a basic benchmark of eslint of pve-manager showed some performance
gains:

Benchmark #1: Current
  Time (mean ± σ):      6.468 s ±  0.116 s    [User: 9.803 s, System: 0.333 s]
  Range (min … max):    6.264 s …  6.647 s    10 runs

Benchmark #2: 2Threads
  Time (mean ± σ):      4.509 s ±  0.106 s    [User: 12.706 s, System: 0.530 s]
  Range (min … max):    4.335 s …  4.674 s    10 runs

Benchmark #3: 4Threads
  Time (mean ± σ):      3.471 s ±  0.033 s    [User: 16.390 s, System: 0.630 s]
  Range (min … max):    3.431 s …  3.542 s    10 runs

Benchmark #4: 8Threads
  Time (mean ± σ):      2.880 s ±  0.044 s    [User: 22.454 s, System: 0.938 s]
  Range (min … max):    2.813 s …  2.964 s    10 runs

Summary
  '8Threads' ran
    1.21 ± 0.02 times faster than '4Threads'
    1.57 ± 0.04 times faster than '2Threads'
    2.25 ± 0.05 times faster than 'Current'

after 8 threads, there were no real performance benefits since the
overhead to load the module seems to be the biggest factor.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-19 12:22:13 +02:00
Dominik Csapak
39179db1a8 remove unnecessary eslint.js
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-19 12:12:46 +02:00
Dominik Csapak
4b0098f62a ship proper nodejs module 'pve-eslint'
instead of concatenating the eslint module into our app.js, ship
a 'pve-eslint' module that exports the built eslint module

to do this, we have to leave the module type on 'umd' instead of
changing to 'var' so that nodejs can properly import it.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-19 12:12:46 +02:00
Thomas Lamprecht
ef0a5638b0 bump version to 7.28.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-09 16:40:31 +02:00
Dominik Csapak
0803a17d52 set cwd of CLIEngine to process.cwd()
it seems it now defaults to '/' as the current working dir, but we
assume the cwd of the process

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-09 16:36:27 +02:00
Thomas Lamprecht
35543d16f3 switch to es2020 for bullseyse
at least in theory this should be enough

https://eslint.org/docs/user-guide/configuring/language-options#specifying-environments

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-09 11:05:52 +02:00
Thomas Lamprecht
d960db16da actually build upstream release 7.28.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-09 11:05:28 +02:00
Thomas Lamprecht
5422a9ccba import eslint 7.28.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-08 11:43:11 +02:00
Thomas Lamprecht
61dc968b37 buildsys: change upload dist to bullseye
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-08 11:39:08 +02:00
Thomas Lamprecht
12c851a9e0 add small script to help extracting more relevant changes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-08 11:38:50 +02:00
Thomas Lamprecht
bd400de844 bump version to 7.18.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:09:00 +01:00
Thomas Lamprecht
45a91473a3 switch to ECMA version 2018
Mainly to enable the rest/spread operator (...variable).

Other new features include asynchronous iteration,
Promise.prototype.finally and additions to RegExp (look behind, named
capture groups, s flag)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:04:47 +01:00
Thomas Lamprecht
456be15ea9 import eslint 7.18.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 16:04:55 +01:00
Thomas Lamprecht
07e2881e8e bump version to 7.12.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-29 12:21:53 +01:00
Thomas Lamprecht
6f03646270 import 7.12.1 upstream release
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-29 11:42:45 +01:00
Thomas Lamprecht
a4a2572412 exit with error also on warnings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-22 12:52:22 +02:00
Thomas Lamprecht
3a486d1dba app: eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-22 12:46:52 +02:00
Thomas Lamprecht
f49981c122 bump version to 7.2.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 16:55:23 +02:00
Thomas Lamprecht
d3726936c1 import and build new upstream release 7.2.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 16:55:23 +02:00
Thomas Lamprecht
551ca188fd ship an example config and extend-rules sample files
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 16:55:23 +02:00
Thomas Lamprecht
d4b999a4ce add HelpInfo variables to globals
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 16:55:23 +02:00
Thomas Lamprecht
6a98065ee9 no-mixed-operators: do not check basic math precedence
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 16:41:45 +02:00
Thomas Lamprecht
e89a2e9218 improve no-extra-parens rule
We use both, 'no-extra-parens' and 'no-mixed-operators' rules and
those can conflict. Thus follow eslints recommendation[0] and allow
parenthesis in nestedBinaryExpressions to avoid the linter
complaining either way. Do this also fo enforceForArrowConditionals
as there I saw the issue already in practice for me.

[0]: https://eslint.org/docs/rules/no-mixed-operators#rule-details

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 16:29:00 +02:00
Thomas Lamprecht
067b576deb try to improve object-curly-newline
for me consistency on open/close is most important..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 14:53:28 +02:00
Thomas Lamprecht
3958e2506b disable 'no-else-return' rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 14:53:28 +02:00
Thomas Lamprecht
3fb7828e97 disable "no-underscore-dangle" as used in explicit unused variables
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 13:37:43 +02:00
Thomas Lamprecht
490226fadd disable semi-style for now
In generally we follow it but we want also to allow statements like:

let foo = bar
    ? 'baz'
    : 'foz'
    ;

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 13:37:43 +02:00
Thomas Lamprecht
630511aeb6 adapt some rules
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 13:29:24 +02:00
Thomas Lamprecht
4e679d18a2 add --output-config CLI option
can help to get the default config for adaption

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 13:29:24 +02:00
Thomas Lamprecht
177b4d5ea7 add possibiliity to extend base config over CLI
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 13:29:24 +02:00
Thomas Lamprecht
756e2b86db factor out path expansion
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 13:29:24 +02:00
Thomas Lamprecht
a4d939da61 no-unused-vars: allow starting with _underscore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 12:57:17 +02:00
Thomas Lamprecht
6a5a0f8851 checkin build of 7.1.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 13:00:56 +02:00
Thomas Lamprecht
ebb53d86fb update to 7.1.0 sources
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 13:00:39 +02:00
Thomas Lamprecht
5661945977 bump version to 7.0.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 14:32:21 +02:00
Dominik Csapak
56c4a2cb43 upgrade to v7.0.0
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-22 13:50:35 +02:00
Thomas Lamprecht
7fd7b12660 bump version to 7.0.0~alpha3-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-10 17:07:16 +02:00
Dominik Csapak
74e9b54320 ignore unused 'me'
sometimes we want to have it just in case

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-10 17:06:08 +02:00
Thomas Lamprecht
6d505c5767 print relative file path
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-10 16:49:37 +02:00
Thomas Lamprecht
7b71dd2c0b re do output formatting, save some lines
Moving the message and the info if something is auto-fixable to a
single line, saving ~ 2/3rd of output lines.

The auto-fixable got replaced with a (*) marker, it's not ideal but
IMO OK; explain what it means in the summaries "X issues marked with
(*) could be auto-fixed"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-10 16:38:43 +02:00
Dominik Csapak
8e4082d9d6 eslint: autofixes
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-10 08:26:51 +02:00
Dominik Csapak
5fad4d8186 allow '!!' for boolean conversion
we use this many times, and it really should not be confusing,
also it is much shorter than: 'Boolean(foo)',

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-10 08:24:59 +02:00
Thomas Lamprecht
feb31555bd bump version to 7.0.0~alpha3-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-09 18:56:07 +02:00
Thomas Lamprecht
8258fbf9bf drop "lints cwd on no params" hint
This is a bit strange behaviour, especially if there's nothing to
lint and one gets just a spewed out nodejs backtracke.. It's not hard
to just to `eslint *.js` or the like..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-09 18:55:09 +02:00
Thomas Lamprecht
ca06ae98f2 rules: dot-location: set location parameter to property
who the heck makes the following syntax the default:
> foo.
>    bar().
>    baz();

So let's enforce the right thing™ and enforce the dot sticking to the
property, not the object, i.e.:

> foo
>    .bar().
>    .baz();

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-09 18:30:40 +02:00