Skip to content

Commit

Permalink
build: Drop ESLint from esbuild
Browse files Browse the repository at this point in the history
Similar to what commit c9ac673 did for stylelint, move
ESLint to static code checks as well. It already runs from there (and
actually correctly since the previous commit).
  • Loading branch information
martinpitt committed Feb 7, 2024
1 parent 005cff4 commit 1a28b31
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
5 changes: 1 addition & 4 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ pkg/lib/), you can also build all pages:

./build.js -w

Note that this enables eslint by default -- if you want to disable it, run it
with `-e`/`--no-eslint`.

Reload cockpit in your browser after page is built. Press `Ctrl`-`C` to
stop watch mode once you are done with changing the code.

Expand Down Expand Up @@ -232,7 +229,7 @@ The tests require at least `pytest` 7.0.0 or higher to run.
Cockpit uses [ESLint](https://eslint.org/) to automatically check JavaScript
code style in `.js` and `.jsx` files.

The linter is executed on every build.
The linter is executed as part of `test/static-code`.

For developer convenience, the ESLint can be started explicitly by:

Expand Down
5 changes: 0 additions & 5 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const qunitOptions = {
const parser = (await import('argparse')).default.ArgumentParser();
parser.add_argument('-r', '--rsync', { help: "rsync bundles to ssh target after build", metavar: "HOST" });
parser.add_argument('-w', '--watch', { action: 'store_true', help: "Enable watch mode" });
parser.add_argument('-e', '--no-eslint', { action: 'store_true', help: "Disable eslint linting", default: production });
parser.add_argument('onlydir', { nargs: '?', help: "The pkg/<DIRECTORY> to build (eg. base1, shell, ...)", metavar: "DIRECTORY" });
const args = parser.parse_args();

Expand Down Expand Up @@ -111,7 +110,6 @@ async function build() {
const cockpitPoEsbuildPlugin = (await import('./pkg/lib/cockpit-po-plugin.js')).cockpitPoEsbuildPlugin;
const cockpitRsyncEsbuildPlugin = (await import('./pkg/lib/cockpit-rsync-plugin.js')).cockpitRsyncEsbuildPlugin;
const cockpitTestHtmlPlugin = (await import('./pkg/lib/esbuild-test-html-plugin.js')).cockpitTestHtmlPlugin;
const eslintPlugin = (await import('./pkg/lib/esbuild-eslint-plugin.js')).eslintPlugin;

const esbuildStylesPlugins = (await import('./pkg/lib/esbuild-common.js')).esbuildStylesPlugins;

Expand All @@ -124,7 +122,6 @@ async function build() {
];

const pkgPlugins = [
...args.no_eslint ? [] : [eslintPlugin({ filter: /pkg\/.*\.(jsx?|js?)$/ })],
cockpitJSResolvePlugin,
...esbuildStylesPlugins
];
Expand Down Expand Up @@ -181,7 +178,6 @@ async function build() {
...qunitOptions,
entryPoints: testEntryPoints,
plugins: [
...args.no_eslint ? [] : [eslintPlugin({ filter: /pkg\/.*\.(jsx?|js?)$/ })],
cockpitTestHtmlPlugin({ testFiles: tests }),
],
});
Expand All @@ -200,7 +196,6 @@ async function build() {
...qunitOptions,
entryPoints: testEntryPoints,
plugins: [
...args.no_eslint ? [] : [eslintPlugin({ filter: /pkg\/.*\.(jsx?|js?)$/ })],
cockpitTestHtmlPlugin({ testFiles: tests }),
],
});
Expand Down
32 changes: 0 additions & 32 deletions pkg/lib/esbuild-eslint-plugin.js

This file was deleted.

0 comments on commit 1a28b31

Please sign in to comment.