Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-pegasus

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-pegasus

Eslint shareable config with personalized defaults

  • 6.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
75
increased by134.38%
Maintainers
0
Weekly downloads
 
Created
Source

eslint-plugin-pegasus

pegasus

Tests npm version npm licence

Eslint shareable config with personalized defaults.

Install

npm install eslint eslint-config-pegasus --save-dev

Usage

See Eslint's Shareable Configs for more information.

import pegasus from 'eslint-config-pegasus';

export default [
  pegasus.configs.default, // core config
  pegasus.configs.stylistic, // stylistic config
];

Additional rules

Node.js

import pegasus from 'eslint-config-pegasus';

export default [
  pegasus.configs.default, // core
  pegasus.configs.node,
];

Typescript

pegasus.tsConfig is a re-export of typescript-eslint's config helper.

import pegasus from 'eslint-config-pegasus';

export default [
  pegasus.configs.default,
  pegasus.configs.node,
  ...pegasus.tsConfig(pegasus.configs.typescript),
];

// Or
export default pegasus.tsConfig(
  pegasus.configs.default,
  pegasus.configs.node,
  ...pegasus.configs.typescript,
);

By default, the following files are matched: **/*.ts, **/*.mts, **/*.cts. To customize this, you can pass the files option.

import pegasus from 'eslint-config-pegasus';

export default pegasus.tsConfig(
  pegasus.configs.default, // core
  pegasus.configs.node, // node
  {
    files: ['**/*.ts', '**/*.tsx'],
    extends: pegasus.configs.typescript,
  },
);
import pegasus from 'eslint-config-pegasus';

export default pegasus.tsConfig(
  pegasus.configs.default,
  pegasus.configs.node,
  ...pegasus.configs.typescriptRecommended,
);

This extendes typescript-eslint/recommended with typechecking

Typescript Strict

import pegasus from 'eslint-config-pegasus';

export default pegasus.tsConfig(
  pegasus.configs.default,
  pegasus.configs.node,
  ...pegasus.configs.typescriptStrict,
);

typescript-strict includes all base, recommended and stylistic configuration

Custom TsConfig

By default, the projectService option is enabled in the parser options, which is needed for certain rules which require type information. This might conflict when passing the project option to the parser.

To override this, you can disable projectService and specify the project to the custom tsconfig file.

import pegasus from 'eslint-config-pegasus';

export default pegasus.tsConfig(
  pegasus.configs.default, // core
  pegasus.configs.node, // node
  {
    extends: pegasus.configs.typescript,
    languageOptions: {
      parserOptions: {
        projectService: false,
        project: './tsconfig.eslint.json',
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },
);

See typescript-eslint's docs for more information.

React

import pegasus from './index.js';

export default [
  pegasus.configs.default,
  {
    ...pegasus.configs.react,
    files: ['test/fixtures/jsx/*.jsx'],
  },
];

Browsers

import pegasus from 'eslint-config-pegasus';

export default [
  pegasus.configs.default, // core
  pegasus.configs.browser,
];

Keywords

FAQs

Package last updated on 05 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc