-
Notifications
You must be signed in to change notification settings - Fork 93
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
Migrate to eslint #627
Conversation
@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",
},
},
}; |
should I lint the whole project and create a follow-up PR, or should we just adopt the new rules gradually |
Yes, replace the outdated rules. Not sure what you mean by linting the whole project. Please expound. |
I mean running the |
Let's not do that in this PR. It will cause a number of merge conflicts. |
* 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 <[email protected]> Co-authored-by: OfficeGlobal <[email protected]> Co-authored-by: OfficeGlobal <[email protected]> Co-authored-by: Azure Static Web Apps <[email protected]> Co-authored-by: Elinor <[email protected]> Co-authored-by: Millicent Achieng <[email protected]> Co-authored-by: Sébastien Levert <[email protected]> Co-authored-by: Ezrqn Kemboi <[email protected]> Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: Joseph Ngugi <[email protected]>
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