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

@ps73/eslint-config

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ps73/eslint-config

Simple yet opinionated eslint setup for my projects.

  • 1.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

ps73/eslint-config

This package provides a shared ESLint configuration for my projects. It includes typescript, prettier and react configurations.

npm install @ps73/eslint-config -D

Usage

To lint .ts, .js, .mjs and .cjs files add the following to your .eslintrc.cjs file:

module.exports = {
  root: true,

  extends: ['@ps73/eslint-config'],
};

Add to your package.json

{
  "prettier": "@ps73/eslint-config/prettier.json"
}

Other EcmaScript Versions

By default the configuration uses ES2022. If you want to use a different version, add the following to your .eslintrc.cjs file:

module.exports = {
  root: true,

  extends: ['@ps73/eslint-config'],

  parserOptions: {
    ecmaVersion: 2023, // or 2022, 2021, 2020, 2019, ...
  },

  // when using react
  overrides: [
    {
      files: ['*.tsx', '*.jsx'],
      env: {
        es2023: true, // or 2022, 2021, 2020, 2019, ...
      },
    },
  ],
};

For React Projects

To lint .ts, .tsx, .js, .jsx, .mjs and .cjs files use the react configuration:

module.exports = {
  root: true,

  extends: ['@ps73/eslint-config/react'],
};

For React Native Projects

To lint .ts, .tsx, .js, .jsx, .mjs and .cjs files use the react configuration:

module.exports = {
  root: true,

  extends: ['@ps73/eslint-config/react-native'],
};

Inside VSCode

Install ESLint Extension and Prettier Extension.

Add to .vscode/settings.json:

{
  "editor.formatOnPaste": false,
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
  },
  "eslint.enable": true,
  "eslint.options": { "reportUnusedDisableDirectives": "error" },
  "eslint.codeAction.disableRuleComment": {
    "enable": true,
    "location": "separateLine",
    "commentStyle": "line",
  },
  "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
}

Keywords

FAQs

Package last updated on 28 Aug 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