How to use the @typescript-eslint/eslint-plugin.configs 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 gatsbyjs / gatsby / .eslintrc.js View on Github external
___emitter: false,
      },
    },
    {
      files: ["**/cypress/integration/**/*", "**/cypress/support/**/*"],
      globals: {
        cy: false,
        Cypress: false,
      },
    },
    {
      files: ["*.ts", "*.tsx"],
      parser: "@typescript-eslint/parser",
      plugins: ["@typescript-eslint/eslint-plugin"],
      rules: {
        ...TSEslint.configs.recommended.rules,
        // This rule ensures that typescript types do not have semicolons
        // at the end of their lines, since our prettier setup is to have no semicolons
        // e.g.,
        // interface Foo {
        // -  baz: string;
        // +  baz: string
        // }
        "@typescript-eslint/member-delimiter-style": [
          "error",
          {
            multiline: {
              delimiter: "none",
            },
          },
        ],
        // This ensures all interfaces are named with an I as a prefix
github swissquote / crafty / packages / eslint-plugin-swissquote / src / typescript-best-practices.js View on Github external
"no-unused-vars": "off",
    "@swissquote/swissquote/@typescript-eslint/no-unused-vars": [
      "error",
      { args: "none", vars: "local", ignoreRestSiblings: true }
    ],

    // Overrides of TypeScript recommended
    "@swissquote/swissquote/@typescript-eslint/explicit-function-return-type": "off",
    "@swissquote/swissquote/@typescript-eslint/explicit-member-accessibility": "off",
    "@swissquote/swissquote/@typescript-eslint/no-empty-function": "warn",
  }
};

addMissingRules(
  require("@typescript-eslint/eslint-plugin").configs.recommended.rules,
  module.exports.rules,
  Object.keys(require("./typescript").rules)
);
github Automattic / wp-calypso / .eslintrc.js View on Github external
'import/no-extraneous-dependencies': 'off',
				'no-console': 'off',
				'jest/valid-describe': 'off',
				'jest/no-test-prefixes': 'off',
				'jest/no-identical-title': 'off',
			},
			globals: {
				step: false,
			},
		},
		merge(
			// ESLint doesn't allow the `extends` field inside `overrides`, so we need to compose
			// the TypeScript config manually using internal bits from various plugins
			{},
			// base TypeScript config: parser options, add plugin with rules
			require( '@typescript-eslint/eslint-plugin' ).configs.base,
			// basic recommended rules config from the TypeScript plugin
			{ rules: require( '@typescript-eslint/eslint-plugin' ).configs.recommended.rules },
			// Prettier rules config
			require( 'eslint-config-prettier/@typescript-eslint' ),
			// Our own overrides
			{
				files: [ '**/*.ts', '**/*.tsx' ],
				rules: {
					'@typescript-eslint/explicit-function-return-type': 'off',
					'@typescript-eslint/explicit-member-accessibility': 'off',
					'@typescript-eslint/no-unused-vars': [ 'error', { ignoreRestSiblings: true } ],
					'@typescript-eslint/no-use-before-define': [
						'error',
						{ functions: false, typedefs: false },
					],
					'no-use-before-define': 'off',
github Automattic / wp-calypso / .eslintrc.js View on Github external
'jest/valid-describe': 'off',
				'jest/no-test-prefixes': 'off',
				'jest/no-identical-title': 'off',
			},
			globals: {
				step: false,
			},
		},
		merge(
			// ESLint doesn't allow the `extends` field inside `overrides`, so we need to compose
			// the TypeScript config manually using internal bits from various plugins
			{},
			// base TypeScript config: parser options, add plugin with rules
			require( '@typescript-eslint/eslint-plugin' ).configs.base,
			// basic recommended rules config from the TypeScript plugin
			{ rules: require( '@typescript-eslint/eslint-plugin' ).configs.recommended.rules },
			// Prettier rules config
			require( 'eslint-config-prettier/@typescript-eslint' ),
			// Our own overrides
			{
				files: [ '**/*.ts', '**/*.tsx' ],
				rules: {
					'@typescript-eslint/explicit-function-return-type': 'off',
					'@typescript-eslint/explicit-member-accessibility': 'off',
					'@typescript-eslint/no-unused-vars': [ 'error', { ignoreRestSiblings: true } ],
					'@typescript-eslint/no-use-before-define': [
						'error',
						{ functions: false, typedefs: false },
					],
					'no-use-before-define': 'off',
					'@typescript-eslint/no-var-requires': 'off',
					// REST API objects include underscores