<commit_before># @treblefm/eslint-config

Shared ESLint config for Treble.fm

## Quick Install

(Copy/paste into your terminal)
```sh
npm install --save-dev \
  @treblefm/eslint-config \
  eslint@4 \
  eslint-plugin-import@2 \
  eslint-plugin-node@5
```

## Dependencies

This config requires the following peer dependencies:
- `eslint@4.x` (obviously)
- `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` <sup>1</sup>
- `eslint-plugin-html@3.x`
- `eslint-plugin-react@7.x` <sup>2</sup>
- `eslint-plugin-react-native@3.x` <sup>3</sup>
- `eslint-plugin-typescript@0.8.x` <sup>4</sup>
- `typescript@2.5.x` <sup>4</sup>
- `typescript-eslint-parser@8` <sup>4</sup>

<sub>
1: See additional notes below<br />
2: JSX parsing and related rules are only enabled in the React Native and TypeScript configs<br />
3: Required by the React Native config<br />
4: Required by the TypeScript config
</sub>

-------------------

## 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`):
```json5
{
  "extends": "@treblefm"
}
```

Browser (ES6):
```json5
{
  "extends": "@treblefm/eslint-config/browser"
}
```

React Native:
```json5
{
  "extends": "@treblefm/eslint-config/react-native"
}
```

TypeScript support can be added to any of the above configs:
```json5
{
  "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](https://github.com/apollographql/eslint-plugin-graphql)).

[`.graphqlconfig`](https://github.com/graphcool/graphql-config)
```json5
{
  "schemaPath": "./path/to/schema.json"
}
```

`.eslintrc`
```json5
{
  "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"
    }]
  }
}
```<commit_msg>Use JS instead of JSON5 highlighting<commit_after># @treblefm/eslint-config

Shared ESLint config for Treble.fm

## Quick Install

(Copy/paste into your terminal)
```sh
npm install --save-dev \
  @treblefm/eslint-config \
  eslint@4 \
  eslint-plugin-import@2 \
  eslint-plugin-node@5
```

## Dependencies

This config requires the following peer dependencies:
- `eslint@4.x` (obviously)
- `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` <sup>1</sup>
- `eslint-plugin-html@3.x`
- `eslint-plugin-react@7.x` <sup>2</sup>
- `eslint-plugin-react-native@3.x` <sup>3</sup>
- `eslint-plugin-typescript@0.8.x` <sup>4</sup>
- `typescript@2.5.x` <sup>4</sup>
- `typescript-eslint-parser@8` <sup>4</sup>

<sub>
1: See additional notes below<br />
2: JSX parsing and related rules are only enabled in the React Native and TypeScript configs<br />
3: Required by the React Native config<br />
4: Required by the TypeScript config
</sub>

-------------------

## 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`):
```js
{
  "extends": "@treblefm" // or @treblefm/eslint-config/node
}
```

Browser (ES6):
```js
{
  "extends": "@treblefm/eslint-config/browser"
}
```

React Native:
```js
{
  "extends": "@treblefm/eslint-config/react-native"
}
```

TypeScript support can be added to any of the above configs:
```js
{
  "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](https://github.com/apollographql/eslint-plugin-graphql)).

[`.graphqlconfig`](https://github.com/graphcool/graphql-config)
```js
{
  "schemaPath": "./path/to/schema.json"
}
```

`.eslintrc`
```js
{
  "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"
    }]
  }
}
```
{'fraction_non_alphanumeric': 0.18799832144355855, 'fraction_numerical': 0.015736466638690726, 'mean_word_length': 3.4971698113207546, 'pattern_counts': {'":': 34, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3968099', 'n_tokens_mistral': 1771, 'n_tokens_neox': 1713, 'n_words': 401}