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

Migrate to eslint #627

Merged
merged 16 commits into from
Jan 20, 2021
Merged

Migrate to eslint #627

merged 16 commits into from
Jan 20, 2021

Conversation

Kachulio1
Copy link
Contributor

Overview

removes tslint and adds eslint

Closes #588

Demo

Optional. Screenshots, curl examples, etc.

Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

Testing Instructions

  • How to test this PR
  • Prefer bulleted description
  • Start after checking out this branch
  • Include any setup required, such as bundling scripts, restarting services, etc.
  • Include test case, and expected output

@Kachulio1
Copy link
Contributor Author

Kachulio1 commented Jul 5, 2020

@jobala the eslintrc.js is the auto-generated from tslint-to-eslint-config and has some old tslint rules, was wondering if I should replace that with these rules instead

module.exports = {
 env: {
   browser: true,
   es6: true,
   node: true,
 },
 extends: [
   "eslint:recommended",
   "plugin:react/recommended",
   "plugin:@typescript-eslint/eslint-recommended",
 ],
 globals: {
   Atomics: "readonly",
   SharedArrayBuffer: "readonly",
 },
 parser: "@typescript-eslint/parser",
 parserOptions: {
   ecmaFeatures: {
     jsx: true,
   },
   ecmaVersion: 2018,
   project: "tsconfig.json",
   sourceType: "module",
 },
 plugins: ["react", "@typescript-eslint", "jsx-a11y"],
 rules: {
   "@typescript-eslint/adjacent-overload-signatures": "error",
   "@typescript-eslint/array-type": "warn",
   "@typescript-eslint/ban-types": "error",
   "@typescript-eslint/class-name-casing": "error",
   "@typescript-eslint/consistent-type-assertions": "error",
   "@typescript-eslint/consistent-type-definitions": "error",
   "@typescript-eslint/explicit-member-accessibility": [
     "off",
     {
       accessibility: "explicit",
     },
   ],
   "@typescript-eslint/indent": "off",
   "@typescript-eslint/interface-name-prefix": "off",
   "@typescript-eslint/member-delimiter-style": [
     "off",
     {
       multiline: {
         delimiter: "none",
         requireLast: true,
       },
       singleline: {
         delimiter: "semi",
         requireLast: false,
       },
     },
   ],
   "@typescript-eslint/member-ordering": "off",
   "@typescript-eslint/no-empty-function": "error",
   "@typescript-eslint/no-empty-interface": "error",
   "@typescript-eslint/no-explicit-any": "off",
   "@typescript-eslint/no-misused-new": "error",
   "@typescript-eslint/no-namespace": "off",
   "@typescript-eslint/no-parameter-properties": "off",
   "@typescript-eslint/no-unused-expressions": [
     "error",
     {
       allowShortCircuit: true,
     },
   ],
   "@typescript-eslint/no-unused-vars": [
     "warn",
     {
       args: "after-used",
       argsIgnorePattern: "^_",
       ignoreRestSiblings: false,
       vars: "all",
     },
   ],
   "@typescript-eslint/no-use-before-define": "off",
   "@typescript-eslint/no-var-requires": "off",
   "@typescript-eslint/prefer-for-of": "error",
   "@typescript-eslint/prefer-function-type": "error",
   "@typescript-eslint/prefer-namespace-keyword": "error",
   "@typescript-eslint/quotes": "off",
   "@typescript-eslint/semi": ["off", null],
   "@typescript-eslint/space-within-parens": ["off", "never"],
   "@typescript-eslint/triple-slash-reference": "error",
   "@typescript-eslint/type-annotation-spacing": "off",
   "@typescript-eslint/unified-signatures": "error",
   "arrow-body-style": "off",
   "arrow-parens": ["off", "as-needed"],
   camelcase: "off",
   "capitalized-comments": "off",
   "comma-dangle": "off",
   complexity: "off",
   "constructor-super": "error",
   curly: "error",
   "dot-notation": "error",
   "eol-last": "off",
   eqeqeq: ["error", "smart"],
   "guard-for-in": "error",
   "id-blacklist": "off",
   "id-match": "error",
   "import/order": "off",
   "linebreak-style": "off",
   "max-classes-per-file": ["error", 1],
   "max-len": "off",
   "new-parens": "off",
   "newline-per-chained-call": "off",
   "no-bitwise": "error",
   "no-caller": "error",
   "no-case-declarations": 0,
   "no-cond-assign": "error",
   "no-console": "warn",
   "no-debugger": "error",
   "no-empty": "error",
   "no-eval": "error",
   "no-extra-boolean-cast": 0,
   "no-extra-semi": "off",
   "no-fallthrough": "off",
   "no-invalid-this": "off",
   "no-irregular-whitespace": "off",
   "no-multiple-empty-lines": "off",
   "no-new-wrappers": "error",
   "no-shadow": [
     "warn",
     {
       hoist: "all",
     },
   ],
   "no-throw-literal": "error",
   "no-trailing-spaces": "off",
   "no-undef-init": "error",
   "no-underscore-dangle": "off",
   "no-unsafe-finally": "error",
   "no-unused-labels": "error",
   "no-unused-vars": "off",
   "no-var": "error",
   "object-shorthand": "error",
   "one-var": ["error", "never"],
   "prefer-arrow/prefer-arrow-functions": "off",
   "prefer-const": "error",
   "quote-props": "off",
   radix: "error",
   "react/no-unescaped-entities": 0,
   "react/prop-types": 0,
   "space-before-function-paren": "off",
   "spaced-comment": "off",
   "use-isnan": "error",
   "valid-typeof": "off",
 },
 settings: {
   react: {
     version: "detect",
   },
 },
};

@Kachulio1
Copy link
Contributor Author

should I lint the whole project and create a follow-up PR, or should we just adopt the new rules gradually

@jobala
Copy link
Contributor

jobala commented Jul 6, 2020

Yes, replace the outdated rules. Not sure what you mean by linting the whole project. Please expound.

@Kachulio1
Copy link
Contributor Author

Yes, replace the outdated rules. Not sure what you mean by linting the whole project. Please expound.

I mean running the lint command on all the files to fix spaces, unused var, etc

@jobala
Copy link
Contributor

jobala commented Jul 8, 2020

I mean running the lint command on all the files to fix spaces, unused var, etc

Let's not do that in this PR. It will cause a number of merge conflicts.

@Shjokie Shjokie added the status:on-hold An issue/PR that we are yet to work on and can't make a decision on when to move forward label Sep 25, 2020
@jobala jobala self-assigned this Jan 18, 2021
@jobala jobala added help wanted Extra attention is needed and removed status:on-hold An issue/PR that we are yet to work on and can't make a decision on when to move forward labels Jan 18, 2021
@thewahome thewahome merged commit 18b5106 into microsoftgraph:dev Jan 20, 2021
thewahome added a commit that referenced this pull request Jan 30, 2021
* Fix - replaces content-type header by accept to match HTTP and avoid CORS pre-flight (#783)

* Fix: modify permissions tab UI (#790)

* Track errors  (#777)

* Fix: sanitize url when fetching permissions (#794)

* Fix: remove wrongly placed working (#795)

* Fix: all permissions show as required (#797)

* Task: autocomplete hover styling (#801)

* Fix: Enable screen reader confirmation feedback (#802)

* Migrate to eslint (#627)

* Feature: resizable components (#766)

* Fix: add onItemInvoked action (#806)

* Fix: permissions consent (#807)

* Task: accessibility ci (#358)

* Fix: prevent resize when view expanded (#816)

* Feature: additional telemetry (#813)

* Fix: permissions tab UI (#815)

* Fix: shrink request section (#822)

Co-authored-by: jobala <japhethobalak@gmail.com>
Co-authored-by: OfficeGlobal <47977325+OfficeGlobal@users.noreply.github.com>
Co-authored-by: OfficeGlobal <OfficeGlobal@microsoft.com>
Co-authored-by: Azure Static Web Apps <opensource@microsoft.com>
Co-authored-by: Elinor <ekaguongo@gmail.com>
Co-authored-by: Millicent Achieng <achieng.milli@gmail.com>
Co-authored-by: Sébastien Levert <sebastienlevert@users.noreply.github.com>
Co-authored-by: Ezrqn Kemboi <ezrqnkemboi@gmail.com>
Co-authored-by: Vincent Biret <vibiret@microsoft.com>
Co-authored-by: Joseph Ngugi <jngugi88@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tslint is dead, long live tslint.
4 participants