diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7caf6f1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] + +# Change these settings to your own preference +[{*.js, *.jsx}] +indent_style = tab +indent_size = 4 + +[{*.json, *.yml}] +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] diff --git a/.eslintrc.json b/.eslintrc.json index 83b89f8..73d11d8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,90 +1,93 @@ { - "extends": "airbnb", - "plugin": ["react"], - "env": { - "browser": true, - "commonjs": true, - "es6": true, - "node": true - }, - "parser": "babel-eslint", + "extends": [ + "airbnb", + "plugin:react/recommended" + ], + "plugins": ["react"], + "env": { + "browser": true, + "commonjs": true, + "es6": true, + "node": true + }, + "parser": "babel-eslint", "parserOptions":{ - "ecmaVersion": 10, - "sourceType": "module", - "ecmaFeatures": { - "jsx": true - } - }, - "rules": { - "semi": ["error", "always"], - "comma-dangle": ["error", { - "arrays": "always-multiline", - "objects": "always-multiline" - }], - "object-curly-spacing": ["error", "always"], - "no-multiple-empty-lines": ["error", { - "max": 1, - "maxEOF": 1 - }], - "eol-last": ["error", "always"], - "indent": ["error", 4], - "no-param-reassign": ["warn"], - "arrow-body-style": ["error", "as-needed"], - "arrow-parens": ["warn", "as-needed", { - "requireForBlockBody": false - }], - "arrow-spacing": ["error", { - "before": true, - "after": true - }], - "constructor-super": "error", - "no-const-assign": "error", - "no-dupe-class-members": "error", - "no-duplicate-imports": "error", - "no-new-symbol": "error", - "no-this-before-super": "error", - "no-useless-computed-key": "error", - "no-useless-constructor": "warn", - "no-useless-rename": ["error", { - "ignoreDestructuring": false, - "ignoreImport": false, - "ignoreExport": false - }], - "no-var": "warn", - "prefer-arrow-callback": ["warn", { - "allowUnboundThis": true - }], - "prefer-const": ["error", { - "destructuring": "all", - "ignoreReadBeforeAssign": true - }], - "prefer-template": "error", - "require-yield": "error", - "rest-spread-spacing": ["error", "never"], - "template-curly-spacing": "error", - "yield-star-spacing": ["error", "after"], - "prefer-spread": "error", - "generator-star-spacing": ["error", { - "before": false, - "after": true - }], - "symbol-description": "error", - "max-len": ["error", { "code": 100 }], - "sort-keys": ["error", "asc"], + "ecmaVersion": 10, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } + }, + "rules": { + "semi": ["error", "always"], + "comma-dangle": ["error", { + "arrays": "always-multiline", + "objects": "always-multiline" + }], + "object-curly-spacing": ["error", "always"], + "no-multiple-empty-lines": ["error", { + "max": 1, + "maxEOF": 1 + }], + "eol-last": ["error", "always"], + "indent": ["error", 4], + "no-param-reassign": ["warn"], + "arrow-body-style": ["error", "as-needed"], + "arrow-parens": ["warn", "as-needed", { + "requireForBlockBody": false + }], + "arrow-spacing": ["error", { + "before": true, + "after": true + }], + "constructor-super": "error", + "no-const-assign": "error", + "no-dupe-class-members": "error", + "no-duplicate-imports": "error", + "no-new-symbol": "error", + "no-this-before-super": "error", + "no-useless-computed-key": "error", + "no-useless-constructor": "warn", + "no-useless-rename": ["error", { + "ignoreDestructuring": false, + "ignoreImport": false, + "ignoreExport": false + }], + "no-var": "warn", + "prefer-arrow-callback": ["warn", { + "allowUnboundThis": true + }], + "prefer-const": ["error", { + "destructuring": "all", + "ignoreReadBeforeAssign": true + }], + "prefer-template": "error", + "require-yield": "error", + "rest-spread-spacing": ["error", "never"], + "template-curly-spacing": "error", + "yield-star-spacing": ["error", "after"], + "prefer-spread": "error", + "generator-star-spacing": ["error", { + "before": false, + "after": true + }], + "symbol-description": "error", + "max-len": ["error", { "code": 100 }], + "sort-keys": ["error", "asc"], - "react/no-danger": "error", - "react/jsx-pascal-case": "error", - "react/jsx-indent": ["error", 4], - "react/jsx-closing-bracket-location": "error", - "react/void-dom-elements-no-children": "error", - "react/jsx-tag-spacing": "error", - "react/jsx-no-literals": "error", - "react/jsx-wrap-multilines": "error", - "react/jsx-no-comment-textnodes": "error" - }, - "settings": { - "react": { - "version": "latest" - } + "react/no-danger": "error", + "react/jsx-pascal-case": "error", + "react/jsx-indent": ["error", 4], + "react/jsx-closing-bracket-location": "error", + "react/void-dom-elements-no-children": "error", + "react/jsx-tag-spacing": "error", + "react/jsx-no-literals": "error", + "react/jsx-wrap-multilines": "error", + "react/jsx-no-comment-textnodes": "error" + }, + "settings": { + "react": { + "version": "latest" } + } } diff --git a/package.json b/package.json index 123dc77..5e8dd63 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "lint": "eslint" + "lint": "eslint pages" }, "repository": { "type": "git", @@ -18,12 +18,14 @@ }, "homepage": "https://github.com/enyeInc/project-template#readme", "devDependencies": { + "babel-eslint": "^10.0.1", "chai": "^4.2.0", "enzyme": "^3.9.0", "eslint": "^5.8.0", "eslint-config-airbnb": "^17.1.0", "eslint-config-standard": "^12.0.0", "eslint-plugin-import": "^2.14.0", + "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-node": "^7.0.1", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-react": "^7.11.1",