Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit 6a9e4b7

Browse files
author
Kent C. Dodds
committed
chore(linting): Change to kentcdodds config conventions
Because I'm tired of copying over my conventions everywhere.
1 parent de900fa commit 6a9e4b7

File tree

6 files changed

+38
-19
lines changed

6 files changed

+38
-19
lines changed

.eslintrc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
2-
"extends": "./node_modules/kcd-common-tools/shared/test.eslintrc",
3-
"rules": {
4-
"max-params": [2, 11] // gotta love me some angular...
5-
},
6-
"globals": {
7-
"inject": false,
8-
"VERSION": false
9-
}
2+
// this exists solely for editors. The test and app eslints are slightly different
3+
// and the app validates the app code via the other/app.eslintrc and validates the
4+
// test code via the other/test.eslintrc
5+
// we simply use the test.eslintrc so our editors don't get mad at us.
6+
"extends": "./other/test.eslintrc"
107
}

other/common.eslintrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"rules": {
3+
"func-names": 0, // I wish, but doing this right now would be a royal pain
4+
"new-cap": [
5+
2,
6+
{
7+
"newIsCap": true,
8+
"capIsNew": true
9+
}
10+
],
11+
"max-params": [2, 10],
12+
"max-statements": [2, 30], // TODO bring this down
13+
},
14+
"globals": {
15+
"VERSION": false
16+
}
17+
}

other/src.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["kentcdodds", "./common.eslintrc"]
3+
}

other/test.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["kentcdodds/test-angular", "./common.eslintrc"],
3+
}

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,17 @@
8585
"angular": "1.4.3",
8686
"angular-mocks": "1.4.3",
8787
"api-check": "^7.3.0",
88-
"babel": "5.8.9",
89-
"babel-core": "5.8.9",
90-
"babel-eslint": "4.0.5",
88+
"babel": "5.8.23",
9189
"babel-loader": "5.3.2",
9290
"better-npm-run": "benoror/better-npm-run#0.0.1",
9391
"chai": "3.2.0",
9492
"codecov.io": "0.1.5",
9593
"commitizen": "1.0.4",
9694
"cz-conventional-changelog": "1.1.0",
97-
"eslint": "0.24.1",
98-
"eslint-loader": "0.14.2",
99-
"eslint-plugin-mocha": "0.4.0",
95+
"eslint": "1.3.1",
96+
"eslint-config-kentcdodds": "3.0.0",
97+
"eslint-loader": "1.0.0",
98+
"eslint-plugin-mocha": "0.5.1",
10099
"ghooks": "0.3.2",
101100
"http-server": "0.8.0",
102101
"isparta": "3.0.3",

src/directives/formly-field.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default formlyField;
99
* @restrict AE
1010
*/
1111
// @ngInject
12-
function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyConfig, formlyValidationMessages,
12+
function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyConfig,
1313
formlyApiCheck, formlyUtil, formlyUsability, formlyWarn) {
1414
const {arrayify} = formlyUtil;
1515

@@ -34,7 +34,7 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo
3434

3535

3636
// @ngInject
37-
function FormlyFieldController($scope, $timeout, $parse, $controller) {
37+
function FormlyFieldController($scope, $timeout, $parse, $controller, formlyValidationMessages) {
3838
/* eslint max-statements:[2, 31] */
3939
if ($scope.options.fieldGroup) {
4040
setupFieldGroup();
@@ -694,9 +694,9 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo
694694
// TODO this is the deprecated API. Remove this in a breaking change.
695695
const checker = instance.shape(apiCheck);
696696
const checkOptions = apiCheckOptions || {
697-
prefix: `formly-field type ${options.type}`,
698-
url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed'
699-
};
697+
prefix: `formly-field type ${options.type}`,
698+
url: formlyApiCheck.config.output.docsBaseUrl + 'formly-field-type-apicheck-failed'
699+
};
700700
instance[fn](checker, options, checkOptions);
701701
}
702702
}

0 commit comments

Comments
 (0)