Skip to content

seegno/jscs-preset-seegno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jscs-preset-seegno

Seegno-flavored JSCS preset.

Installation

$ npm install jscs jscs-preset-seegno --save-dev

Usage

Create an .jscsrc file with the following:

preset: seegno

Add the following script to your package.json:

{
  "scripts": {
    "lint": "jscs ."
  }
}

and run the linter with:

$ npm run lint

Custom rules

The preset includes the following list of custom rules.

requireSqlTemplate

Disallows the usage of raw SQL templates with interpolation.

This rule enforces the usage of a library such as sql-tag, which escapes data provided to an SQL query statement via interpolation, helping to avoid, for instance, potential injection attacks.

Requires: sql-tag

Type: Boolean

Value: true

Example

requireSqlTemplate: true

Valid

const column = '*';
const query = sql`SELECT ${column} FROM foobar`;

fn(sql`SELECT ${column} FROM foobar`)

Invalid

const column = '*';
const query = `SELECT ${column} FROM foobar`;

fn(`SELECT ${column} FROM foobar`)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •