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

@gossi/config-eslint

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gossi/config-eslint

Add eslint to your packages. Based on [NullVoxPopuli/eslint-config](https://github.com/NullVoxPopuli/eslint-configs).

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
877
increased by16.01%
Maintainers
1
Weekly downloads
 
Created
Source

@gossi/config-eslint

Add eslint to your packages. Based on NullVoxPopuli/eslint-config.

Installation

  1. Install these packages:

    pnpm add -D @gossi/config-eslint eslint
    
  2. Create a .eslintrc.js file with your desired config (see below)

  3. Add scripts to execute linting

    {
      "scripts": {
        "lint:js": "eslint . --cache",
        "lint:js:fix": "eslint . --fix"
      }
    }
    

Configs

Ember

Accommodates: JS, TS, App, and Addon

// .eslintrc.js
'use strict';
const { configs } = require('@gossi/config-eslint');

module.exports = configs.ember();

Node

This config is native ES Modules, and cjs is allowed via files with the *.cjs extension.

// .eslintrc.js
'use strict';
const { configs } = require('@gossi/config-eslint');
// accommodates: JS
module.exports = configs.node();

Node (CJS as defaultl)

This config is for when *.js is cjs, and ES Modules are used via the *.mjs extension.

// .eslintrc.js
'use strict';
const { configs } = require('@gossi/config-eslint');
// accommodates: JS
module.exports = configs.nodeCJS();

Node (ES Modules in TypeScript)

// .eslintrc.js
'use strict';
const { configs } = require('@gossi/config-eslint');
// accommodates: JS, TS
module.exports = configs.nodeTS();

Overriding

Every of the above config is overridable. Here are two examples of how you can override the provided configs:

overriding:

// .eslintrc.js
'use strict';
const { configs } = require('@gossi/config-eslint');
const config = configs.ember();
module.exports = {
  ...config,
  overrides: [
    ...config.overrides,
    // your modifications here
    // see: https://eslint.org/docs/user-guide/configuring/configuration-files#how-do-overrides-work
  ]
}

overriding prettier configuration example:

// .eslintrc.js
'use strict';
const { configs } = require('@gossi/config-eslint');
const config = configs.ember();
module.exports = {
  ...config,
  overrides: [
    ...config.overrides,
    {
      files: ['**/*.js', '**/*.ts'],
      rules: {
        'prettier/prettier': ['error', { singleQuote: true, printWidth: 120, trailingComma: 'none' }],
      },
    },
  ]
}

FAQs

Package last updated on 17 Dec 2022

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