New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@20i/eslint-config

Package Overview
Dependencies
Maintainers
16
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@20i/eslint-config

ESLint and Prettier Config for Twenty Ideas

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
988
decreased by-20%
Maintainers
16
Weekly downloads
 
Created
Source

eslint-config-20i

publish npm (scoped)

Auto Install

Use mrm to install all dependencies and add config files.

npx mrm eslint --preset @20i/mrm-preset

Manual Install

  1. Install dev dependencies:

    yarn add -D eslint prettier typescript @20i/eslint-config
    # or
    npm i -D eslint prettier typescript @20i/eslint-config
    
  2. Create a new file, .eslintrc.js, in the directory of your project.

  3. Add the following code to the file.

    module.exports = {
      extends: ["@20i/eslint-config"],
      parserOptions: {
        project: ["./tsconfig.eslint.json"],
      },
      ignorePatterns: [],
    }
    

    ⚠️ For React projects, set @20i/eslint-config/react instead.

  4. Add a special tsconfig.json file to your project: tsconfig.eslint.json

    {
      // extend your base config to share compilerOptions, etc
      "extends": "./tsconfig.json",
      "compilerOptions": {
        // ensure that nobody can accidentally use this config for a build
        "noEmit": true
      },
      "include": [
        "**/*",
        "**/.*"
      ],
    }
    
  5. Add the following to your .prettierrc file:

    {
      "endOfLine": "auto",
      "semi": false,
      "trailingComma": "es5"
    }
    

Configure VS Code

  1. Make sure these extensions are installed:

    code --install-extension dbaeumer.vscode-eslint && \
    code --install-extension esbenp.prettier-vscode
    
  2. Add the following to your global ~/.vscode/settings.json file:

    {
      "editor.codeActionsOnSave": {
        "source.fixAll": true
      },
      // format on save for everything, but what prettier will handle through eslint
      "editor.formatOnSave": true,
      "[javascriptreact]": {
        "editor.formatOnSave": false,
      },
      "[javascript]": {
        "editor.formatOnSave": false,
      },
      "[typescript]": {
        "editor.formatOnSave": false,
      },
      "[typescriptreact]": {
        "editor.formatOnSave": false,
      },
    }
    
  3. Restart VS Code

References

Inspired heavily by eslint-config-wesbos

Keywords

FAQs

Package last updated on 18 Oct 2023

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