From 13feb7278e5c19c7e1b8d9177447525088e34e53 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 29 Jun 2016 16:40:35 -0400 Subject: [PATCH] init --- .../babel-eslint-config-internal/.gitignore | 1 + eslint/babel-eslint-config-internal/README.md | 3 + eslint/babel-eslint-config-internal/index.js | 64 +++++++++++++++++++ .../babel-eslint-config-internal/package.json | 21 ++++++ 4 files changed, 89 insertions(+) create mode 100644 eslint/babel-eslint-config-internal/.gitignore create mode 100644 eslint/babel-eslint-config-internal/README.md create mode 100644 eslint/babel-eslint-config-internal/index.js create mode 100644 eslint/babel-eslint-config-internal/package.json diff --git a/eslint/babel-eslint-config-internal/.gitignore b/eslint/babel-eslint-config-internal/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/eslint/babel-eslint-config-internal/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/eslint/babel-eslint-config-internal/README.md b/eslint/babel-eslint-config-internal/README.md new file mode 100644 index 0000000000..9978722d8b --- /dev/null +++ b/eslint/babel-eslint-config-internal/README.md @@ -0,0 +1,3 @@ +eslint-config-babel + +eslint config for the babel codebase (copied from eslint-config-kittens) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js new file mode 100644 index 0000000000..11a9baa560 --- /dev/null +++ b/eslint/babel-eslint-config-internal/index.js @@ -0,0 +1,64 @@ +module.exports = { + parser: "babel-eslint", + extends: "eslint:recommended", + plugins: ["flow-vars", "babel"], + rules: { + "flow-vars/define-flow-type": 1, + "flow-vars/use-flow-type": 1, + quotes: [2, "double"], + "no-var": 2, + "keyword-spacing": 2, + strict: 0, + "no-underscore-dangle": 0, + curly: 0, + "no-multi-spaces": 0, + "key-spacing": 0, + "no-return-assign": 0, + "consistent-return": 0, + "no-shadow": 0, + "comma-dangle": 0, + "no-use-before-define": 0, + "no-empty": 0, + "new-parens": 0, + "no-cond-assign": 0, + "no-fallthrough": 0, + "new-cap": 0, + "no-loop-func": 0, + "no-unreachable": 0, + "no-labels": 0, + "no-process-exit": 0, + camelcase: 0, + "no-console": 0, + "no-constant-condition": 0, + "no-inner-declarations": 0, + "no-case-declarations": 0, + semi: [2, "always"], + + // soft indent of 2 characters + "indent": [2, 2], + + // maximum length of 110 characters + "max-len": [2, 110, 2], + + // Enforce parens around arrow function arguments + "babel/arrow-parens": [2, "always"], + // Require a space on each side of arrow operator + "arrow-spacing": [2, { before: true, after: true }], + // Prevent using => in a condition where <= is intended + "no-confusing-arrow": 2, + // prevent no space in `if (){` + "space-before-blocks": "always" + }, + + globals: { + // Flow + Iterator: true, + $Keys: true + }, + + env: { + node: true, + es6: true, + browser: true + } +}; diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json new file mode 100644 index 0000000000..04c3b0b3d1 --- /dev/null +++ b/eslint/babel-eslint-config-internal/package.json @@ -0,0 +1,21 @@ +{ + "name": "eslint-config-babel", + "version": "1.0.0", + "description": "eslint config for babel", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/eslint-config-babel" + }, + "main": "index.js", + "dependencies": { + "babel-eslint": "^6.0.0", + "eslint-plugin-babel": "^3.0.0", + "eslint-plugin-flow-vars": "^0.4.0" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } +}