Skip to content
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

eslint config with typescript support, some basic rules #860

Merged
merged 7 commits into from
Dec 7, 2021

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Aug 31, 2021

This re-enables eslint, making npm run lint:js run both eslint and prettier,
configures it to use the typescript-capable @typescript-eslint/parser,
starts off with eslint:recommended, react/recommended, @typescript-eslint/recommended and prettier rules,

and for now just disables anything that creates errors, as we can address individual rules in follow-up PRs
(except a couple of single-file issues fixed manually here)

(The current config generated too many errors, we can add individual rules as needed in separate PRs as well, leaving in a reminder comment for now.)

…slint/parser eslint eslint-config-prettier eslint-plugin-react typescript
the config is really just the defaults, globals and plugins,
and then disabling any rules that generates warnings for now

so that we can enable eslint, and then fix individual rules in separate PRs
    /home/himdel/ansible-hub-ui/config/webpack.base.config.js
      1:11  error  'require' is already defined as a built-in global variable    no-redeclare
      1:20  error  'module' is already defined as a built-in global variable     no-redeclare
      1:28  error  '__dirname' is already defined as a built-in global variable  no-redeclare

    /home/himdel/ansible-hub-ui/src/components/collection-list/collection-filter.tsx
      49:34  error  Expected a `const` instead of a literal type assertion  @typescript-eslint/prefer-as-const

    /home/himdel/ansible-hub-ui/src/components/empty-state/empty-state-unauthorized.tsx
      7:11  error  An empty interface is equivalent to `{}`  @typescript-eslint/no-empty-interface

    /home/himdel/ansible-hub-ui/src/components/repositories/remote-repository-table.tsx
      46:14  error  Empty block statement  no-empty

    /home/himdel/ansible-hub-ui/src/containers/execution-environment-detail/execution_environment_detail_activities.tsx
      72:39  error  Unexpected empty arrow function  @typescript-eslint/no-empty-function

    /home/himdel/ansible-hub-ui/src/index.d.ts
      11:1  error  Unexpected var, use let or const instead  no-var
      12:1  error  Unexpected var, use let or const instead  no-var
      13:1  error  Unexpected var, use let or const instead  no-var
      14:1  error  Unexpected var, use let or const instead  no-var
      15:1  error  Unexpected var, use let or const instead  no-var
      16:1  error  Unexpected var, use let or const instead  no-var
      17:1  error  Unexpected var, use let or const instead  no-var

    /home/himdel/ansible-hub-ui/src/loaders/insights/insights-loader.js
      26:5   error  'insights' is not defined  no-undef
      27:5   error  'insights' is not defined  no-undef
      32:19  error  'insights' is not defined  no-undef
      60:5   error  'insights' is not defined  no-undef
@himdel himdel marked this pull request as ready for review December 5, 2021 06:24
Copy link
Member

@ZitaNemeckova ZitaNemeckova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@himdel himdel merged commit 58d1ff7 into ansible:master Dec 7, 2021
@himdel himdel deleted the eslint branch December 7, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants