diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js new file mode 100644 index 00000000000000..2e488a745ee39c --- /dev/null +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -0,0 +1,109 @@ +module.exports = { + parser: 'babel-eslint', + + plugins: [ + 'mocha', + 'babel', + 'react', + 'import' + ], + + env: { + es6: true, + amd: true, + node: true, + mocha: true, + browser: true, + }, + + parserOptions: { + sourceType: 'module', + ecmaVersion: 6, + ecmaFeatures: { experimentalObjectRestSpread: true }, + }, + + rules: { + 'block-scoped-var': 'error', + camelcase: [ 'error', { properties: 'never' } ], + 'comma-dangle': 'off', + 'comma-style': [ 'error', 'last' ], + 'consistent-return': 'off', + curly: [ 'error', 'multi-line' ], + 'dot-location': [ 'error', 'property' ], + 'dot-notation': [ 'error', { allowKeywords: true } ], + eqeqeq: [ 'error', 'allow-null' ], + 'guard-for-in': 'error', + indent: [ 'error', 2, { SwitchCase: 1 } ], + 'key-spacing': [ 'off', { align: 'value' } ], + 'max-len': [ 'error', 140, 2, { ignoreComments: true, ignoreUrls: true } ], + 'new-cap': [ 'error', { capIsNewExceptions: [ 'Private' ] } ], + 'no-bitwise': 'off', + 'no-caller': 'error', + 'no-cond-assign': 'off', + 'no-const-assign': 'error', + 'no-debugger': 'error', + 'no-empty': 'error', + 'no-eval': 'error', + 'no-extend-native': 'error', + 'no-extra-parens': 'off', + 'no-extra-semi': [ 'error' ], + 'no-global-assign': 'error', + 'no-irregular-whitespace': 'error', + 'no-iterator': 'error', + 'no-loop-func': 'error', + 'no-multi-spaces': 'off', + 'no-multi-str': 'error', + 'no-nested-ternary': 'error', + 'no-new': 'off', + 'no-path-concat': 'off', + 'no-proto': 'error', + 'no-redeclare': 'error', + 'no-restricted-globals': [ 'error', 'context' ], + 'no-return-assign': 'off', + 'no-script-url': 'error', + 'no-sequences': 'error', + 'no-shadow': 'off', + 'no-trailing-spaces': 'error', + 'no-undef': 'error', + 'no-underscore-dangle': 'off', + 'no-unused-expressions': 'off', + 'no-unused-vars': [ 'error' ], + 'no-use-before-define': [ 'error', 'nofunc' ], + 'no-var': 'error', + 'no-with': 'error', + 'one-var': [ 'error', 'never' ], + 'prefer-const': 'error', + quotes: [ 'error', 'single', { allowTemplateLiterals: true } ], + 'semi-spacing': [ 'error', { before: false, after: true } ], + semi: [ 'error', 'always' ], + 'space-before-blocks': [ 'error', 'always' ], + 'space-before-function-paren': [ 'error', { anonymous: 'always', named: 'never' } ], + 'space-in-parens': [ 'error', 'never' ], + 'space-infix-ops': [ 'error', { int32Hint: false } ], + 'space-unary-ops': [ 'error' ], + strict: [ 'error', 'never' ], + 'valid-typeof': 'error', + 'wrap-iife': [ 'error', 'outside' ], + yoda: 'off', + + 'object-curly-spacing': 'off', // overriden with babel/object-curly-spacing + 'babel/object-curly-spacing': [ 'error', 'always' ], + + 'react/jsx-uses-react': 'error', + 'react/jsx-uses-vars': 'error', + 'react/jsx-no-undef': 'error', + 'react/jsx-pascal-case': 'error', + + 'mocha/handle-done-callback': 'error', + 'mocha/no-exclusive-tests': 'error', + + 'import/no-unresolved': [ 'error', { 'amd': true, 'commonjs': true } ], + 'import/named': 'error', + 'import/namespace': 'error', + 'import/default': 'error', + 'import/export': 'error', + 'import/no-named-as-default': 'error', + 'import/no-named-as-default-member': 'error', + 'import/no-duplicates': 'error', + } +} \ No newline at end of file diff --git a/packages/eslint-config-kibana/.gitignore b/packages/eslint-config-kibana/.gitignore new file mode 100644 index 00000000000000..7c0c9807a8b7d9 --- /dev/null +++ b/packages/eslint-config-kibana/.gitignore @@ -0,0 +1,36 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +node_modules + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history +.eslintrc.json + +yarn.lock \ No newline at end of file diff --git a/packages/eslint-config-kibana/.npmignore b/packages/eslint-config-kibana/.npmignore new file mode 100644 index 00000000000000..2ba159593147da --- /dev/null +++ b/packages/eslint-config-kibana/.npmignore @@ -0,0 +1,2 @@ +.eslintrc.yaml +tasks diff --git a/packages/eslint-config-kibana/README.md b/packages/eslint-config-kibana/README.md new file mode 100644 index 00000000000000..4b20fc999b48a2 --- /dev/null +++ b/packages/eslint-config-kibana/README.md @@ -0,0 +1,3 @@ +# eslint-config-kibana + +The eslint config used by the kibana team diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json new file mode 100644 index 00000000000000..09e2ee7db6b86c --- /dev/null +++ b/packages/eslint-config-kibana/package.json @@ -0,0 +1,28 @@ +{ + "name": "@elastic/eslint-config-kibana", + "version": "0.7.0", + "description": "The eslint config used by the kibana team", + "main": ".eslintrc.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/elastic/eslint-config-kibana.git" + }, + "keywords": [], + "author": "Spencer Alger ", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/elastic/eslint-config-kibana/issues" + }, + "homepage": "https://github.com/elastic/eslint-config-kibana#readme", + "peerDependencies": { + "babel-eslint": "^7.2.3", + "eslint": "^4.1.0", + "eslint-plugin-babel": "^4.1.1", + "eslint-plugin-import": "^2.6.0", + "eslint-plugin-mocha": "^4.9.0", + "eslint-plugin-react": "^7.0.1" + } +}