Skip to content

Commit edf5537

Browse files
committed
Close #133 Add OrgSync .eslintrc
1 parent 3932728 commit edf5537

6 files changed

Lines changed: 226 additions & 20 deletions

File tree

.eslintrc

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
{
2+
"parser": "babel-eslint",
3+
"parserOptions": {
4+
"sourceType": "module",
5+
"ecmaVersion": 6,
6+
"ecmaFeatures": {
7+
"jsx": true
8+
},
9+
},
10+
"plugins": [
11+
"react"
12+
],
13+
"env": {
14+
"amd": true,
15+
"browser": true,
16+
"es6": true,
17+
"mocha": true,
18+
"node": true,
19+
"phantomjs": true,
20+
"worker": true
21+
},
22+
"globals": {
23+
"__DEV__": true
24+
},
25+
"rules": {
26+
"comma-dangle": [2, "never"],
27+
"no-comma-dangle": 0,
28+
"no-cond-assign": [0, "except-parens"],
29+
"no-console": 1,
30+
"no-constant-condition": 0,
31+
"no-control-regex": 2,
32+
"no-debugger": 1,
33+
"no-dupe-args": 2,
34+
"no-dupe-keys": 2,
35+
"no-duplicate-case": 2,
36+
"no-empty": 0,
37+
"no-empty-character-class": 2,
38+
"no-ex-assign": 2,
39+
"no-extra-boolean-cast": 2,
40+
"no-extra-parens": 0,
41+
"no-extra-semi": 2,
42+
"no-func-assign": 2,
43+
"no-inner-declarations": 0,
44+
"no-invalid-regexp": 2,
45+
"no-irregular-whitespace": 2,
46+
"no-negated-in-lhs": 2,
47+
"no-obj-calls": 2,
48+
"no-regex-spaces": 2,
49+
"no-reserved-keys": 0,
50+
"no-sparse-arrays": 2,
51+
"no-unreachable": 2,
52+
"use-isnan": 2,
53+
"valid-jsdoc": 0,
54+
"valid-typeof": 2,
55+
"block-scoped-var": 0,
56+
"complexity": 0,
57+
"consistent-return": 0,
58+
"curly": [2, "multi-line"],
59+
"default-case": 0,
60+
"dot-notation": [2, {"allowKeywords": true}],
61+
"eqeqeq": 0,
62+
"guard-for-in": 0,
63+
"no-alert": 1,
64+
"no-caller": 2,
65+
"no-div-regex": 0,
66+
"no-else-return": 2,
67+
"no-labels": [2, {"allowLoop": true, "allowSwitch": true}],
68+
"no-eq-null": 0,
69+
"no-eval": 2,
70+
"no-extend-native": 2,
71+
"no-extra-bind": 2,
72+
"no-fallthrough": 0,
73+
"no-floating-decimal": 2,
74+
"no-implied-eval": 2,
75+
"no-iterator": 2,
76+
"no-lone-blocks": 2,
77+
"no-loop-func": 0,
78+
"no-multi-spaces": 2,
79+
"no-multi-str": 2,
80+
"no-native-reassign": 2,
81+
"no-new": 2,
82+
"no-new-func": 2,
83+
"no-new-wrappers": 2,
84+
"no-octal": 2,
85+
"no-octal-escape": 2,
86+
"no-param-reassign": 0,
87+
"no-process-env": 1,
88+
"no-proto": 2,
89+
"no-redeclare": 2,
90+
"no-return-assign": 0,
91+
"no-script-url": 2,
92+
"no-self-compare": 2,
93+
"no-sequences": 0,
94+
"no-throw-literal": 2,
95+
"no-unused-expressions": 2,
96+
"no-void": 2,
97+
"no-warning-comments": 0,
98+
"no-with": 2,
99+
"radix": 0,
100+
"vars-on-top": 0,
101+
"wrap-iife": 0,
102+
"yoda": [2, "never"],
103+
"global-strict": 0,
104+
"no-extra-strict": 0,
105+
"strict": 0,
106+
"no-catch-shadow": 0,
107+
"no-delete-var": 2,
108+
"no-label-var": 2,
109+
"no-shadow": 0,
110+
"no-shadow-restricted-names": 2,
111+
"no-undef": 2,
112+
"no-undef-init": 2,
113+
"no-undefined": 0,
114+
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
115+
"no-use-before-define": 0,
116+
"handle-callback-err": 0,
117+
"no-mixed-requires": 0,
118+
"no-new-require": 2,
119+
"no-path-concat": 2,
120+
"no-process-exit": 0,
121+
"no-restricted-modules": 0,
122+
"no-sync": 0,
123+
"indent": [2, 2],
124+
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
125+
"camelcase": [2, {"properties": "never"}],
126+
"comma-spacing": [2, {"before": false, "after": true}],
127+
"comma-style": [2, "last"],
128+
"consistent-this": 0,
129+
"eol-last": 2,
130+
"func-names": 0,
131+
"func-style": [2, "expression"],
132+
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
133+
"max-nested-callbacks": [1, 3],
134+
"new-cap": 0,
135+
"new-parens": 2,
136+
"newline-after-var": 0,
137+
"no-array-constructor": 2,
138+
"no-inline-comments": 2,
139+
"no-lonely-if": 2,
140+
"no-mixed-spaces-and-tabs": 2,
141+
"no-multiple-empty-lines": [2, {"max": 1}],
142+
"no-nested-ternary": 0,
143+
"no-new-object": 2,
144+
"no-space-before-semi": 0,
145+
"no-spaced-func": 2,
146+
"no-ternary": 0,
147+
"no-trailing-spaces": 2,
148+
"no-underscore-dangle": 0,
149+
"one-var": 0,
150+
"operator-assignment": [2, "always"],
151+
"padded-blocks": 0,
152+
"quote-props": [2, "as-needed"],
153+
"quotes": [2, "single", "avoid-escape"],
154+
"semi": [2, "always"],
155+
"semi-spacing": [2, {"before": false, "after": true}],
156+
"sort-vars": 0,
157+
"space-after-function-name": 0,
158+
"keyword-spacing": 2,
159+
"space-before-blocks": [2, "always"],
160+
"space-before-function-paren": [2, {
161+
"anonymous": "always",
162+
"named": "never"
163+
}],
164+
"space-before-function-parentheses": 0,
165+
"space-in-parens": [2, "never"],
166+
"object-curly-spacing": [2, "never"],
167+
"array-bracket-spacing": [2, "never"],
168+
"computed-property-spacing": [2, "never"],
169+
"space-infix-ops": [2],
170+
"space-unary-ops": [2, {"words": true, "nonwords": false}],
171+
"space-unary-word-ops": 0,
172+
"spaced-comment": [2, "always"],
173+
"wrap-regex": 0,
174+
"no-var": 0,
175+
"generator-star": 0,
176+
"generator-star-spacing": [2, "after"],
177+
"max-depth": [1, 3],
178+
"max-len": [1, 80, 4],
179+
"max-params": [1, 4],
180+
"max-statements": 0,
181+
"no-bitwise": 0,
182+
"no-plusplus": 0,
183+
"react/display-name": 0,
184+
"react/jsx-boolean-value": 0,
185+
"jsx-quotes": [2, "prefer-single"],
186+
"react/jsx-no-undef": 2,
187+
"react/jsx-sort-props": 0,
188+
"react/jsx-uses-react": 2,
189+
"react/jsx-uses-vars": 2,
190+
"react/no-did-mount-set-state": 2,
191+
"react/no-did-update-set-state": 2,
192+
"react/no-multi-comp": 0,
193+
"react/no-unknown-property": 2,
194+
"react/prop-types": 1,
195+
"react/react-in-jsx-scope": 2,
196+
"react/self-closing-comp": 2,
197+
"react/wrap-multilines": 2
198+
}
199+
}

cogs.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
module.exports = {
2-
pipe: {
3-
name: 'babel',
4-
options: {
5-
presets: ['es2015', 'stage-0', 'react'],
6-
plugins: [['transform-es2015-modules-umd', {
7-
globals: {
8-
react: 'React',
9-
'react-dom': 'ReactDOM',
10-
'react-list': 'ReactList'
11-
},
12-
moduleId: 'react-list',
13-
exactGlobals: true
14-
}]]
2+
pipe: [
3+
'eslint',
4+
{
5+
name: 'babel',
6+
options: {
7+
presets: ['es2015', 'stage-0', 'react'],
8+
plugins: [['transform-es2015-modules-umd', {
9+
globals: {
10+
react: 'React',
11+
'react-dom': 'ReactDOM',
12+
'react-list': 'ReactList'
13+
},
14+
moduleId: 'react-list',
15+
exactGlobals: true
16+
}]]
17+
}
1518
}
16-
},
19+
],
1720
builds: {
1821
'react-list.es6': 'react-list.js',
1922
'examples/index.es6': 'examples/index.js'

examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
function _class() {
222222
_classCallCheck(this, _class);
223223

224-
return _possibleConstructorReturn(this, Object.getPrototypeOf(_class).apply(this, arguments));
224+
return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
225225
}
226226

227227
_createClass(_class, [{

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
"react-dom": "0.14 || 15"
1414
},
1515
"devDependencies": {
16-
"babel-preset-es2015": "6.13.2",
16+
"babel-eslint": "6.1.2",
17+
"babel-plugin-transform-es2015-modules-umd": "6.12.0",
18+
"babel-preset-es2015": "6.14.0",
1719
"babel-preset-react": "6.11.1",
1820
"babel-preset-stage-0": "6.5.0",
19-
"babel-plugin-transform-es2015-modules-umd": "6.12.0",
2021
"cogs": "2.0.9",
2122
"cogs-transformer-babel": "2.0.4",
22-
"cogs-transformer-replace": "1.0.1"
23+
"cogs-transformer-eslint": "2.0.0",
24+
"cogs-transformer-replace": "1.0.1",
25+
"eslint-plugin-react": "6.1.2",
26+
"eslint": "3.3.1"
2327
}
2428
}

react-list.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,4 @@ module.exports = class ReactList extends Component {
450450
};
451451
return <div {...{style}}><div style={listStyle}>{items}</div></div>;
452452
}
453-
}
453+
};

react-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
function ReactList(props) {
124124
_classCallCheck(this, ReactList);
125125

126-
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ReactList).call(this, props));
126+
var _this = _possibleConstructorReturn(this, (ReactList.__proto__ || Object.getPrototypeOf(ReactList)).call(this, props));
127127

128128
var _this$props = _this.props;
129129
var initialIndex = _this$props.initialIndex;

0 commit comments

Comments
 (0)