3.3.4 • Published 6 years ago

@treblefm/eslint-config v3.3.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

@treblefm/eslint-config

Shared ESLint config for Treble.fm

Quick Install

(Copy/paste into your terminal)

npm install --save-dev \
  @treblefm/eslint-config \
  eslint@4 \
  eslint-import-resolver-react-native@0.1 \
  eslint-import-resolver-typescript@1 \
  eslint-plugin-import@2 \
  eslint-plugin-node@5

Dependencies

This config requires the following peer dependencies:

  • eslint@4.x (obviously)
  • eslint-import-resolver-react-native@0.1.x 1
  • eslint-import-resolver-typescript@1.x 1
  • eslint-plugin-import@2.x
  • eslint-plugin-node@5.x

Additionally, these optional peer dependencies will automatically be used if installed:

  • eslint-plugin-graphql@1.x 2
  • eslint-plugin-html@4.x
  • eslint-plugin-react@7.x
  • eslint-plugin-react-native@3.x 3
  • eslint-plugin-typescript@0.8.x 4
  • typescript@2.x 4
  • typescript-eslint-parser@12.x 4

Usage

By default, this config assumes a Node.js project with ES2017 syntax (though unsupported features will be reported as errors by eslint-plugin-node):

{
  "extends": "@treblefm" // or @treblefm/eslint-config/node
}

Browser (ES6):

{
  "extends": "@treblefm/eslint-config/browser"
}

React Native (includes JSX support):

{
  "extends": "@treblefm/eslint-config/react-native"
}

JSX support can be added to any of the above configs:

{
  "extends": [
    "@treblefm",
    "@treblefm/eslint-config/jsx"
  ]
}

Similarly, TypeScript support can also be added (includes JSX support):

{
  "extends": [
    "@treblefm",
    "@treblefm/eslint-config/typescript"
  ]
}

Note about GraphQL

While GraphQL is supported, the rules are disabled by default and some configuration is required (click here for more info).

.graphqlconfig

{
  "schemaPath": "./path/to/schema.json"
}

.eslintrc

{
  "extends": "@treblefm",
  "rules": {
    "graphql/template-strings": [2, {
      "env": "apollo",
      // "validators": [/* see GraphQL's `specifiedRules` */]
    }],
    "graphql/named-operations": [2, {
      "env": "apollo"
    }],
    "graphql/required-fields": [2, {
      "env": "apollo",
      "requiredFields": ["id"]
    }],
    "graphql/capitalized-type-name": [2, {
      "env": "apollo"
    }]
  }
}
3.3.4

6 years ago

3.3.3

6 years ago

3.3.2

6 years ago

3.3.1

6 years ago

3.3.0

7 years ago

3.2.0

7 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.4.1

7 years ago

2.4.0

7 years ago

2.3.3

7 years ago

2.3.2

7 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.8.0

7 years ago

1.7.1

7 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago