Skip to content

Commit

Permalink
feat: Add eslint package (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
RabbitDoge authored Mar 17, 2021
1 parent 018d7e5 commit 0e0454e
Show file tree
Hide file tree
Showing 4 changed files with 1,432 additions and 2,153 deletions.
15 changes: 15 additions & 0 deletions packages/eslint-config-pancake/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# eslint-config-pancake

Pancake Eslint config with:

- Airbnb config
- Typescript
- Prettier

## Usage

```
npx install-peerdeps --dev @pancakeswap-libs/eslint-config-pancake
```

Add `"extends": "@pancakeswap-libs/eslint-config-pancake"` to your eslint config file.
54 changes: 54 additions & 0 deletions packages/eslint-config-pancake/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2017,
ecmaFeatures: {
jsx: true,
},
},
env: {
es6: true,
browser: true,
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".ts", ".jsx", ".tsx"],
},
},
"import/extensions": [".js", ".ts", ".jsx", ".tsx"],
},
extends: [
"airbnb",
"airbnb/hooks",
"prettier",
"prettier/react",
"prettier/@typescript-eslint",
"plugin:@typescript-eslint/recommended",
],
rules: {
// Typescript
"@typescript-eslint/no-unused-vars": "warn",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["warn"],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
// React
"react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
"react/prop-types": 0,
"react/jsx-props-no-spreading": 0,
"react/no-multi-comp": 0,
"import/extensions": [
"error",
"ignorePackages",
{
js: "never",
mjs: "never",
jsx: "never",
ts: "never",
tsx: "never",
},
],
},
};
27 changes: 27 additions & 0 deletions packages/eslint-config-pancake/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@pancakeswap-libs/eslint-config-pancake",
"version": "1.0.0",
"description": "Eslint config for PancakeSwap",
"main": "lib/index.js",
"files": [
"lib"
],
"repository": "git@github.com:pancakeswap/eslint-config-pancake.git",
"license": "MIT",
"author": "RabbitDoge",
"private": false,
"dependencies": {
"@typescript-eslint/eslint-plugin": "^4.7.0",
"@typescript-eslint/parser": "^4.7.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.0.0"
},
"peerDependencies": {
"eslint": "^7.2.0",
"prettier": "^2.1.2"
}
}
Loading

0 comments on commit 0e0454e

Please sign in to comment.