Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'task/add-eslint' into task/add-prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
msanroman committed Jun 12, 2020
2 parents cdcdcf1 + 49b8283 commit eac9e1f
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
24 changes: 24 additions & 0 deletions eslint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# @bufferapp/eslint-config-bufferapp

This is the standard ESLint config files for the projects within the @bufferapp
GitHub organization.

## Usage

```console
npm install --save-dev @bufferapp/eslint-config eslint
# or
yarn add -D @bufferapp/eslint-config eslint
```

NOTE: We will need to define custom installation instructions for front-end
and backend-based configs, depending on those we will have different
`peerDependencies` for the ESLint configs.

And then, on your `.eslintrc` use:

```
"extends": "@bufferapp/eslint-config-bufferapp/backend"
#or
"extends": "@bufferapp/eslint-config-bufferapp/frontend"
```
17 changes: 17 additions & 0 deletions eslint/backend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
extends: [
"./index.js",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
],
plugins: [
"typescript-eslint",
],
parser: "@typescript-eslint/parser",
ignorePatterns: ["node_modules/*"],
env: {
node: true,
es6: true,
jest: true,
}
}
15 changes: 15 additions & 0 deletions eslint/frontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: [
"./index.js",
"plugin:react/recommended",
"prettier/react"
],
plugins: [
"react",
],
env: {
browser: true,
es6: true,
jest: true,
}
}
13 changes: 13 additions & 0 deletions eslint/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
extends: [
"standard",
"eslint:recommended",
"prettier",
],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module"
},
plugins: ["prettier", "jest"],
}

14 changes: 14 additions & 0 deletions eslint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@bufferapp/eslint-config-bufferapp",
"version": "0.0.1",
"description": "This package provides Buffer's ESLint as an extensible shared config, and specific backend/frontend setups.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Mike San Román <[email protected]>",
"license": "ISC",
"peerDependencies": {
"eslint": ">= 6"
}
}

0 comments on commit eac9e1f

Please sign in to comment.