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

@roq/eslint-plugin

Package Overview
Dependencies
Maintainers
6
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@roq/eslint-plugin

roq-linter aims to make sure that our code abides by the defined coding conventions in our rulebook. The aim is to achieve a higher degree of review automation.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

roq-linter

So with roq-linter we want to make sure that our code adheres to the coding convention rulebook, the idea is to make automated checks. Obviously we don't aim to check logical workflows that require human involvement with technical expertise. But whatever can be caught before a PR goes under review, needs to be caught to reduce effort on the side of the reviewer and swaps of control between the PR owner/opener/raiser and the reviewer.

How to configure this plugin to work with your roq project?

So, we expose three different configurations, specific to the type of resources (backend/frontend):

  • Common Config (Contains general conventions that are useful for the entire project)
  • Backend Config (Contains backend related conventions that are useful for project's directory that contains the code for backend)
  • Frontend Config (Contains frontend related conventions that are useful for project's directory that contains the code frontend)

Step 1: Add the roq-linter plugin as a dependency to your project:

npm install -D @roq/eslint-plugin-roq-linter

Step 2: Add required configurations to eslint configuration file(.eslintrc):

Configure the plugin:

plugins: ['@roq/roq-linter'],

Extend the desired config:

extends: ['plugin:@roq/roq-linter/backendConfig','plugin:@roq/roq-linter/commonConfig'],

Add the settings for this plugin:

The settings expects the following details (the path separator to be used while defining these values should be nix-styled '/'):

  • backendBasePath (default:'backend/src') => 'The base relative path (from project's root) of backend related code'

  • frontendBasePath (default:'frontend/src') => 'The base relative path (from project's root) of frontend related code'

  • backendTestsBasePath (default:'backend/tests') => 'The relative path (from project's root) of backend related tests'

  • backendModules (default:["auth", "config", "event", "library", "platform", "user"]) => 'A list of relative paths (from backendBasePath) to backend modules'

"settings": {
    "roq-linter":{
      "backendBasePath": "backend/src",
      "frontendBasePath": "frontend/src",
      "backendTestsBasePath": "backend/tests",
      "backendModules": ["auth", "config", "event", "library", "platform", "user", "nested/sample"]
    }
  }

Step 3: Some rules of this plugin need to be manually configured in your eslint configuration file(.eslintrc):

no-invalid-dirname

The configuration specifies the naming criteria for your directory names, what characters, what case, also do you want to allow numbers. The default configuration is to have lowercased alphanumeric strings with dots and hyphens.

no-use-deprecated-modules

The configuration specifies the node modules that your project should not use. This rule helps in instances for modules that are popular amongst devs but have been deprecated.

no-use-global-module

The configuration specifies the nestjs modules that are global and hence need not be imported by other modules.

See our entire documentation here to know all the roq-conventions.

Keywords

FAQs

Package last updated on 15 Apr 2021

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