Skip to content

Commit

Permalink
fix(eslint): add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeex3 committed Dec 5, 2019
1 parent 233d5e5 commit 1225013
Show file tree
Hide file tree
Showing 4 changed files with 675 additions and 19 deletions.
80 changes: 80 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"parser": "babel-eslint",
"extends": [
"@webex/eslint-config-react",
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended",
"prettier/react"
],
"plugins": ["react", "jsx-a11y", "import", "prettier", "react-hooks"],
"env": {
"browser": true,
"jest": true
},
"globals": {
"expect": true
},
"rules": {
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"arrow-body-style": [
"error",
"as-needed",
{
"requireReturnForObjectLiteral": false
}
],
"prefer-arrow-callback": [
"error",
{
"allowNamedFunctions": false,
"allowUnboundThis": true
}
],
"no-confusing-arrow": ["error"],
"jsx-a11y/no-autofocus": 0,
"jsx-a11y/media-has-caption": 0,
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["hrefLeft", "hrefRight"],
"aspects": ["invalidHref", "preferButton"]
}
],
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": ["draft"]
}
],
"require-jsdoc": "off",
"default-case": 0,
"no-warning-comments": 0,
"import/no-unresolved": 2,
"import/prefer-default-export": 0,
"import/no-named-as-default": 0,
"class-methods-use-this": 0,
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}
],
"no-console": 2,
"no-underscore-dangle": [
"error",
{
"allow": [],
"allowAfterThis": false,
"allowAfterSuper": false,
"enforceInMethodNames": true
}
]
}
}
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"bracketSpacing": false,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 120,
"arrowParens": "always"
}
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"author": "Michael Wegman (mwegman@cisco.com)",
"license": "MIT",
"scripts": {
"lint": "eslint src",
"lint-fix": "eslint --fix src",
"start": "webpack-dev-server --config webpack/dev.config.js",
"build": "webpack --config webpack/prod.config.js",
"prepublishOnly": "yarn build",
Expand Down Expand Up @@ -46,16 +48,29 @@
"@semantic-release/changelog": "3.0.6",
"@semantic-release/git": "7.0.18",
"@storybook/react": "5.2.8",
"@webex/eslint-config-base": "0.8.0",
"@webex/eslint-config-react": "0.8.0",
"babel-eslint": "10.0.3",
"babel-loader": "^8.0.5",
"babel-preset-minify": "^0.5.1",
"clean-webpack-plugin": "^1.0.1",
"css-loader": "^2.1.0",
"dotenv-webpack": "^1.7.0",
"eslint": "6.7.2",
"eslint-config-airbnb": "18.0.1",
"eslint-config-prettier": "6.7.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-mocha": "6.2.2",
"eslint-plugin-prettier": "3.1.1",
"eslint-plugin-react": "7.17.0",
"eslint-plugin-react-hooks": "2.3.0",
"html-webpack-plugin": "^3.2.0",
"husky": "3.1.0",
"mini-css-extract-plugin": "0.8.0",
"node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "5.0.3",
"prettier": "1.19.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"resolve-url-loader": "^3.0.0",
Expand Down
Loading

0 comments on commit 1225013

Please sign in to comment.