Commit graph

16 commits

Author SHA1 Message Date
Jelle van der Waa
0c1f8d0357 .eslintrc.json: boolean values are deprecated for globals
As per ESLint docs these options still allow boolean values but in
reality they are deprecated and replaced by "readonly". Oxlint currently
cannot deal with this and therefore cannot parse the eslint
configuration file.

https://eslint.org/docs/latest/use/configure/language-options#using-configuration-files
2024-05-21 14:15:42 +02:00
Jelle van der Waa
c86352d179 eslint: enable no-useless-fragment rule by default
This rule is not part of the standard ESLint recommends set but is
useful and can be auto-fixed.
2024-04-22 18:35:58 +02:00
Jelle van der Waa
ab04f35fc7 package.json: drop flowtype plugin
None of the Cockpit projects use flowtype's type annotation.
2023-10-03 21:09:08 +02:00
Allison Karlitskaya
2215aa3bf8 Makefile: bump our test/common dependency
... and make use of the new pywrap feature from our test.

Use the same eslint and stylelint plugin configuration as the cockpit
main repo.

Co-authored-by: Katerina Koukiou <kkoukiou@redhat.com>
2023-05-26 17:34:51 +02:00
Subho
1c30b49d3d
Move from webpack to esbuild bundler 2023-04-12 10:23:20 +02:00
Katerina Koukiou
fe1a9a387f package.json: bump eslint to ^8.0.0 and all eslint-x dependencies
So as to satisfy the new eslint peer dependency.

In addition drop eslint-config-standard-react as it does not release
anymore, and eslint 8.x is not compatible with the available last
release.
https://github.com/standard/eslint-config-standard-react/pull/69

Replace it with https://github.com/facebook/create-react-app#readme
which is actively maintained.

Lastly drop the deprecated
https://github.com/standard/eslint-plugin-standard
2022-04-11 07:56:29 +02:00
Katerina Koukiou
67640c7088 Install eslint-plugin-standard-jsx to align with what main cockpit repo does 2022-02-11 18:41:06 +01:00
Katerina Koukiou
fdba1dc96c Bump up eslint-config-standard-react and add fix for the new warnings
This started giving errors like:
  22:10  error  'Alert' is defined but never used      no-unused-vars

Use eslint-plugin-react to improve the JSX usage, not just to silence this error.
2022-02-11 15:13:11 +01:00
Martin Pitt
7dc9fda241 eslint: Enable no-var rule
`var` has broken/unexpected scoping in JavaScript, and can lead to
subtle errors. It's preferable and safer to use `const` whenever
possible, and `let` where necessary.

There are no usages of `var` in starter-kit right now, so just enable
the rule to ensure that it stays that way.
2021-09-21 10:35:11 +02:00
Martin Pitt
0e608d562a Use current babel/eslint integration
Fixes these `npm install` warnings:

> deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
> deprecated eslint-loader@4.0.2: This loader has been deprecated. Please use eslint-webpack-plugin
2021-04-09 09:46:56 +02:00
Martin Pitt
04d6c566c7 eslint: Drop some disabled but desirable warnings
Project authors can/should decide about these by themselves.
2021-04-09 09:46:56 +02:00
Martin Pitt
024b1a2b16 Add eslint rules for React hooks
These make components with simple state (only a few variables) easier to
read and maintain. See https://reactjs.org/docs/hooks-intro.html for
details. Hook are available since React 16.8, and we already depend on 16.10.

We can't use hooks in our actual code, as our only `Application`
component needs a constructor. But this enables the ESLint plugin to
guide developers to the right path if they use hooks.

Closes #239
2019-10-18 13:00:17 +02:00
Sanne Raymaekers
044b8da55a
eslintrc: Set "root" to true
Eslint shimmies up directories looking for more eslintrcs. As
make-checkout now clones projects in a subdirectory of cockpit, this can
result in some strange interactions.

https://eslint.org/docs/user-guide/configuring

Closes #212
2019-08-21 17:50:44 +02:00
Martin Pitt
f6430895c7
Move to latest eslint standard plugin
This fixes the three warnings that recently started to appear:

    [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "standard-react")
    [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "node_modules/eslint-config-standard-jsx/index.js")
    [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "standard")

Closes #99
2019-02-06 09:48:55 +01:00
Martin Pitt
133badfa3d Enable a lot of eslint options and plugins
Taken rules from Cockpit, which have been proven to be effective for
finding bugs and keeping clean code, and sensible (not taking
unreasonable effort to satisfy).

Fix code layout in app.jsx accordingly.

Closes #39
2018-08-28 22:57:52 +02:00
Dominik Perpeet
a01820e565 Add more sample content to subscriptions page 2017-07-26 10:33:14 +02:00