Code Monkey home page Code Monkey logo

eslint-config-sentry's Introduction

Install

yarn add -D eslint-config-sentry

For packages that use react: yarn add -D eslint-config-sentry-react

Configuration

In your .eslintrc (or equivalent config file)

Use sentry for base rules, sentry-react contains rules for eslint-plugin-import and eslint-plugin-react.

{
  "extends": [
    "sentry-react",
  ],
}

Deployment

Create a new branch and PR when creating and tagging a new release. Then run

yarn release

to bump the verison (it current will always be a minor bump) and create a commit. lerna will also try to update relevant CHANGELOGs based on conventional commits.

After merging to master, GitHub Actions will be used to publish to the npm registry.

eslint-config-sentry's People

Contributors

abhiprasad avatar anonrig avatar billyvg avatar dashed avatar dependabot[bot] avatar evanpurkhiser avatar jonasba avatar leedongwei avatar lynnagara avatar markstory avatar matejminar avatar maxbittker avatar nhsiehgit avatar priscilawebdev avatar scttcper avatar vuluongj20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-config-sentry's Issues

eslint config for SDKs

Yo

We would also like to move to eslint for our JS SDK monorepo.
We are still using tslint for now but eventually, we need to switch.

I was using https://github.com/typescript-eslint/tslint-to-eslint-config to convert our existing config (see toggle)

It would still require an eslint wizard to go over this, having an eslint-config-sentry-sdks would be nice.

tslint -> eslint
/*
๐Ÿ‘‹ Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config

It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.

We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md

Happy linting! ๐Ÿ’–
*/
module.exports = {
  env: {
    browser: true,
    node: true,
  },
  extends: ['plugin:@typescript-eslint/all', 'prettier', 'prettier/@typescript-eslint'],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: 'tsconfig.json',
    sourceType: 'module',
  },
  plugins: ['@typescript-eslint', '@typescript-eslint/tslint'],
  rules: {
    '@typescript-eslint/adjacent-overload-signatures': 'error',
    '@typescript-eslint/array-type': [
      'error',
      {
        default: 'array-simple',
      },
    ],
    '@typescript-eslint/await-thenable': 'error',
    '@typescript-eslint/ban-ts-ignore': 'off',
    '@typescript-eslint/ban-types': [
      'error',
      {
        types: {
          async: {
            message: 'Use Promises instead, it add a lot to bundle size.',
          },
        },
      },
    ],
    '@typescript-eslint/class-name-casing': 'error',
    '@typescript-eslint/consistent-type-assertions': 'error',
    '@typescript-eslint/consistent-type-definitions': 'error',
    '@typescript-eslint/dot-notation': 'error',
    '@typescript-eslint/explicit-member-accessibility': [
      'error',
      {
        accessibility: 'explicit',
        overrides: {
          accessors: 'explicit',
          constructors: 'explicit',
          parameterProperties: 'explicit',
        },
      },
    ],
    '@typescript-eslint/indent': 'off',
    '@typescript-eslint/interface-name-prefix': 'error',
    '@typescript-eslint/member-delimiter-style': [
      'off',
      {
        multiline: {
          delimiter: 'none',
          requireLast: true,
        },
        singleline: {
          delimiter: 'semi',
          requireLast: false,
        },
      },
    ],
    '@typescript-eslint/member-ordering': 'error',
    '@typescript-eslint/no-empty-function': 'error',
    '@typescript-eslint/no-empty-interface': 'error',
    '@typescript-eslint/no-explicit-any': 'off',
    '@typescript-eslint/no-extraneous-class': 'error',
    '@typescript-eslint/no-floating-promises': 'error',
    '@typescript-eslint/no-for-in-array': 'error',
    '@typescript-eslint/no-inferrable-types': 'off',
    '@typescript-eslint/no-misused-new': 'error',
    '@typescript-eslint/no-namespace': 'error',
    '@typescript-eslint/no-non-null-assertion': 'error',
    '@typescript-eslint/no-param-reassign': 'error',
    '@typescript-eslint/no-parameter-properties': 'off',
    '@typescript-eslint/no-require-imports': 'off',
    '@typescript-eslint/no-this-alias': 'error',
    '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
    '@typescript-eslint/no-unnecessary-qualifier': 'error',
    '@typescript-eslint/no-unnecessary-type-arguments': 'error',
    '@typescript-eslint/no-unnecessary-type-assertion': 'error',
    '@typescript-eslint/no-unused-expressions': 'error',
    '@typescript-eslint/no-unused-vars': 'off',
    '@typescript-eslint/no-use-before-define': 'error',
    '@typescript-eslint/no-var-requires': 'error',
    '@typescript-eslint/prefer-for-of': 'error',
    '@typescript-eslint/prefer-function-type': 'error',
    '@typescript-eslint/prefer-namespace-keyword': 'error',
    '@typescript-eslint/prefer-readonly': 'error',
    '@typescript-eslint/promise-function-async': 'off',
    '@typescript-eslint/quotes': 'off',
    '@typescript-eslint/require-await': 'error',
    '@typescript-eslint/restrict-plus-operands': 'error',
    '@typescript-eslint/semi': ['off', null],
    '@typescript-eslint/strict-boolean-expressions': 'off',
    '@typescript-eslint/triple-slash-reference': [
      'error',
      {
        path: 'always',
        types: 'prefer-import',
        lib: 'always',
      },
    ],
    '@typescript-eslint/type-annotation-spacing': 'off',
    '@typescript-eslint/unbound-method': 'error',
    '@typescript-eslint/unified-signatures': 'error',
    'arrow-body-style': ['error', 'always'],
    'arrow-parens': ['off', 'always'],
    'brace-style': ['off', 'off'],
    camelcase: 'error',
    'class-methods-use-this': 'off',
    'comma-dangle': 'off',
    complexity: 'error',
    'constructor-super': 'error',
    curly: 'error',
    'default-case': 'error',
    'eol-last': 'off',
    eqeqeq: ['error', 'always'],
    'guard-for-in': 'error',
    'id-blacklist': [
      'error',
      'any',
      'Number',
      'number',
      'String',
      'string',
      'Boolean',
      'boolean',
      'Undefined',
      'undefined',
    ],
    'id-match': 'error',
    'import/no-default-export': 'error',
    'import/no-deprecated': 'error',
    'import/no-extraneous-dependencies': 'error',
    'import/no-internal-modules': 'off',
    'import/no-unassigned-import': 'error',
    'import/order': 'error',
    'jsdoc/check-alignment': 'error',
    'jsdoc/check-indentation': 'error',
    'jsdoc/newline-after-description': 'error',
    'jsdoc/no-types': 'error',
    'linebreak-style': 'off',
    'max-classes-per-file': ['error', 1],
    'max-len': 'off',
    'max-lines': ['error', 1000],
    'new-parens': 'off',
    'newline-per-chained-call': 'off',
    'no-bitwise': 'error',
    'no-caller': 'error',
    'no-cond-assign': 'error',
    'no-console': [
      'error',
      {
        allow: [
          'debug',
          'info',
          'dirxml',
          'warn',
          'error',
          'dir',
          'time',
          'timeEnd',
          'timeLog',
          'trace',
          'assert',
          'clear',
          'count',
          'countReset',
          'group',
          'groupCollapsed',
          'groupEnd',
          'table',
          'Console',
          'markTimeline',
          'profile',
          'profileEnd',
          'timeline',
          'timelineEnd',
          'timeStamp',
          'context',
        ],
      },
    ],
    'no-debugger': 'error',
    'no-duplicate-case': 'error',
    'no-duplicate-imports': 'error',
    'no-empty': 'error',
    'no-eval': 'error',
    'no-extra-bind': 'error',
    'no-extra-semi': 'off',
    'no-irregular-whitespace': 'off',
    'no-magic-numbers': 'off',
    'no-multiple-empty-lines': 'off',
    'no-new-func': 'error',
    'no-new-wrappers': 'error',
    'no-null/no-null': 'off',
    'no-plusplus': [
      'off',
      {
        allowForLoopAfterthoughts: true,
      },
    ],
    'no-redeclare': 'error',
    'no-restricted-syntax': ['error', 'ForInStatement'],
    'no-return-await': 'error',
    'no-sequences': 'error',
    'no-shadow': [
      'error',
      {
        hoist: 'all',
      },
    ],
    'no-sparse-arrays': 'error',
    'no-template-curly-in-string': 'error',
    'no-throw-literal': 'error',
    'no-trailing-spaces': 'off',
    'no-undef-init': 'error',
    'no-underscore-dangle': 'error',
    'no-unsafe-finally': 'error',
    'no-unused-labels': 'error',
    'no-useless-constructor': 'error',
    'no-var': 'error',
    'no-void': 'error',
    'object-shorthand': 'error',
    'one-var': ['error', 'never'],
    'padding-line-between-statements': [
      'off',
      {
        blankLine: 'always',
        prev: '*',
        next: 'return',
      },
    ],
    'prefer-arrow/prefer-arrow-functions': 'error',
    'prefer-const': 'error',
    'prefer-object-spread': 'error',
    'prefer-template': 'error',
    'quote-props': 'off',
    radix: 'error',
    'space-before-function-paren': 'off',
    'space-in-parens': ['off', 'never'],
    'spaced-comment': [
      'error',
      'always',
      {
        markers: ['/'],
      },
    ],
    'unicorn/filename-case': 'error',
    'use-isnan': 'error',
    yoda: 'error',
    '@typescript-eslint/tslint/config': [
      'error',
      {
        rules: {
          'comment-type': [true, 'singleline', 'multiline', 'doc', 'directive'],
          'completed-docs': [
            true,
            {
              classes: {
                tags: {
                  content: {},
                  existence: ['inheritDoc', 'hidden'],
                },
              },
              enums: {
                tags: {
                  content: {},
                  existence: ['inheritDoc', 'hidden'],
                },
              },
              'enum-members': {
                tags: {
                  content: {},
                  existence: ['inheritDoc', 'hidden'],
                },
              },
              functions: {
                tags: {
                  content: {},
                  existence: ['inheritDoc', 'hidden'],
                },
              },
              interfaces: {
                tags: {
                  content: {},
                  existence: ['inheritDoc', 'hidden'],
                },
              },
              methods: {
                tags: {
                  content: {},
                  existence: ['inheritDoc', 'hidden'],
                },
              },
              properties: {
                tags: {
                  content: {},
                  existence: ['inheritDoc', 'hidden'],
                },
                locations: 'instance',
              },
            },
          ],
          encoding: true,
          'invalid-void': true,
          'match-default-export-name': true,
          'naming-convention': [
            true,
            {
              type: 'member',
              modifiers: 'protected',
              leadingUnderscore: 'require',
            },
            {
              type: 'member',
              modifiers: 'private',
              leadingUnderscore: 'require',
            },
          ],
          'no-default-import': true,
          'no-dynamic-delete': true,
          'no-inferred-empty-object-type': true,
          'no-mergeable-namespace': true,
          'no-null-undefined-union': true,
          'no-promise-as-boolean': true,
          'no-restricted-globals': true,
          'no-tautology-expression': true,
          'no-unnecessary-callback-wrapper': true,
          'no-unsafe-any': true,
          'object-literal-sort-keys': true,
          'prefer-conditional-expression': true,
          'prefer-method-signature': true,
          'prefer-switch': true,
          'prefer-while': true,
          'return-undefined': true,
          'static-this': true,
          'strict-comparisons': true,
          'strict-string-expressions': true,
          'strict-type-predicates': true,
          'switch-final-break': true,
          typedef: [true, 'call-signature', 'parameter', 'property-declaration', 'member-variable-declaration'],
          'unnecessary-else': true,
        },
      },
    ],
  },
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.