How to use the @typescript-eslint/eslint-plugin/dist/configs/recommended.json.rules function in @typescript-eslint/eslint-plugin

To help you get started, we’ve selected a few @typescript-eslint/eslint-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github th3rdwave / react-native-safe-area-context / .eslintrc.js View on Github external
* LICENSE file in the root directory of this source tree.
 *
 * @format
 */

const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json');
const typescriptEslintPrettier = require('eslint-config-prettier/@typescript-eslint');

module.exports = {
  extends: ['@react-native-community'],
  overrides: [
    {
      files: ['*.ts', '*.tsx'],
      // Apply the recommended Typescript defaults and the prettier overrides to all Typescript files
      rules: Object.assign(
        typescriptEslintRecommended.rules,
        typescriptEslintPrettier.rules,
        {
          '@typescript-eslint/explicit-member-accessibility': 'off',
          '@typescript-eslint/explicit-function-return-type': 'off',
          '@typescript-eslint/no-use-before-define': 'off',
          '@typescript-eslint/ban-ts-ignore': 'off',
          'react-native/no-inline-styles': 'off',
        },
      ),
    },
  ],
};
github dfrankland / hyper-sync-settings / .eslintrc.js View on Github external
files: ['*.ts'],
      parser: '@typescript-eslint/parser',
      // NOTE: Workaround for no nested extends possible.
      // See https://github.com/eslint/eslint/issues/8813.
      // Working solution would be following, if we had nested extends:
      // ```
      // extends: [
      //   'airbnb-base',
      //   'plugin:@typescript-eslint/recommended',
      //   'prettier/@typescript-eslint',
      //   'prettier',
      // ],
      // ```
      plugins: ['@typescript-eslint', 'prettier'],
      rules: Object.assign(
        typescriptEslintRecommended.rules,
        typescriptEslintPrettier.rules,
        {
          '@typescript-eslint/explicit-function-return-type': 'error',
        },
      ),
    },
  ],
};
github react-native-community / react-native-netinfo / .eslintrc.js View on Github external
* LICENSE file in the root directory of this source tree.
 *
 * @format
 */

const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json');
const typescriptEslintPrettier = require('eslint-config-prettier/@typescript-eslint');

module.exports = {
  extends: ['@react-native-community'],
  overrides: [
    {
      files: ['*.ts', '*.tsx'],
      // Apply the recommended Typescript defaults and the prettier overrides to all Typescript files
      rules: Object.assign(
        typescriptEslintRecommended.rules,
        typescriptEslintPrettier.rules,
        {
          '@typescript-eslint/explicit-member-accessibility': 'off',
        },
      ),
    },
    {
      files: ['example/**/*.ts', 'example/**/*.tsx'],
      rules: {
        // Turn off rules which are useless and annoying for the example files files
        '@typescript-eslint/explicit-function-return-type': 'off',
        'react-native/no-inline-styles': 'off',
      },
    },
    {
      files: ['**/__tests__/**/*.ts', '**/*.spec.ts'],
github dfrankland / react-amphtml / .eslintrc.js View on Github external
files: ['*.ts', '*.tsx'],
      parser: '@typescript-eslint/parser',
      // NOTE: Workaround for no nested extends possible.
      // See https://github.com/eslint/eslint/issues/8813.
      // Working solution would be following, if we had nested extends:
      // ```
      // extends: [
      //   'airbnb-base',
      //   'plugin:@typescript-eslint/recommended',
      //   'prettier/@typescript-eslint',
      //   'prettier',
      // ],
      // ```
      plugins: ['@typescript-eslint', 'prettier'],
      rules: Object.assign(
        typescriptEslintRecommended.rules,
        typescriptEslintPrettier.rules,
        {
          '@typescript-eslint/explicit-function-return-type': 'error',
        },
      ),
    },
    {
      files: [
        'setupTest.js',
        'setupTest.ts',
        '*.spec.js',
        '*.spec.ts',
        '*.spec.tsx',
      ],
      env: {
        jest: true,
github react-native-community / react-native-permissions / .eslintrc.js View on Github external
const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json');
const typescriptEslintPrettier = require('eslint-config-prettier/@typescript-eslint');

module.exports = {
  extends: ['@react-native-community'],
  overrides: [
    {
      files: ['./mock.js'],
      env: {jest: true},
    },
    {
      files: ['*.ts', '*.tsx'],
      // Apply the recommended Typescript defaults and the prettier overrides to all Typescript files
      rules: Object.assign(
        typescriptEslintRecommended.rules,
        typescriptEslintPrettier.rules,
        {
          '@typescript-eslint/explicit-member-accessibility': 'off',
          '@typescript-eslint/no-empty-function': 'off',
        },
      ),
    },
    {
      files: ['example/**/*.ts', 'example/**/*.tsx'],
      rules: {
        // Turn off rules which are useless and annoying for the example files files
        '@typescript-eslint/explicit-function-return-type': 'off',
        'react-native/no-inline-styles': 'off',
      },
    },
  ],
github coralproject / talk / .eslintrc.js View on Github external
},
  },
  plugins: [
    "@typescript-eslint",
    "@typescript-eslint/tslint",
    "react",
    "jsx-a11y",
  ],
  settings: {
    react: {
      version: "detect",
    }
  },
  rules: Object.assign(
    typescriptEslintRecommended.rules,
    typescriptRecommended.rules,
    typescriptEslintPrettier.rules,
    react.rules,
    jsxA11y.rules,
    reactPrettier.rules,
    {
      "@typescript-eslint/adjacent-overload-signatures": "error",
      // TODO: (cvle) change `readonly` param to `array-simple` when upgraded typescript.
      "@typescript-eslint/array-type": ["error", { "default": "array-simple", "readonly": "generic"}],
      "@typescript-eslint/ban-types": "error",
      "@typescript-eslint/camelcase": "off",
      "@typescript-eslint/consistent-type-assertions": "error",
      "@typescript-eslint/consistent-type-definitions": "error",
      "@typescript-eslint/class-name-casing": "error",
      "@typescript-eslint/explicit-function-return-type": "off",
      "@typescript-eslint/explicit-member-accessibility": [
        "error",