chore(lint): add linting, fix lint errors

This commit is contained in:
Alex Gyoshev 2016-01-25 16:52:05 +02:00
Родитель e12f91e0a2
Коммит 9b21f5e888
6 изменённых файлов: 24 добавлений и 60 удалений

Просмотреть файл

@ -1,40 +0,0 @@
{
"extends": "./node_modules/kendo-common-tasks/.eslintrc",
"ecmaFeatures": {
"jsx": true
},
"plugins": [ "react" ],
"rules": {
"react/display-name": 0,
"react/forbid-prop-types": 2,
"react/jsx-boolean-value": 2,
"react/jsx-closing-bracket-location": 2,
"react/jsx-curly-spacing": 2,
"react/jsx-indent-props": 2,
"react/jsx-key": 2,
"react/jsx-max-props-per-line": [2, { "maximum": 4 }],
"react/jsx-no-bind": 2,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-literals": 0,
"react/jsx-no-undef": 2,
"react/jsx-pascal-case": 2,
"react/jsx-sort-prop-types": 2,
"react/jsx-sort-props": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/no-danger": 2,
"react/no-did-mount-set-state": 2,
"react/no-did-update-set-state": 2,
"react/no-direct-mutation-state": 2,
"react/no-multi-comp": 2,
"react/no-set-state": 2,
"react/no-unknown-property": 2,
"react/prefer-es6-class": 2,
"react/prop-types": 2,
"react/react-in-jsx-scope": 2,
"react/require-extension": 2,
"react/self-closing-comp": 2,
"react/sort-comp": 2,
"react/wrap-multilines": 2
}
}

3
.eslintrc.json Normal file
Просмотреть файл

@ -0,0 +1,3 @@
{
"extends": "./node_modules/@telerik/eslint-config/react.js"
}

Просмотреть файл

@ -1,14 +1,14 @@
const jasmine = require('gulp-jasmine')
const specReporter = require('jasmine-spec-reporter')
const webpackConfig = require('./webpack.config.js')
const jasmine = require('gulp-jasmine');
const specReporter = require('jasmine-spec-reporter');
const webpackConfig = require('./webpack.config.js');
const commonTasks = require('kendo-common-tasks');
const SRC = "src/*.jsx"
const TESTS = "test/*.jsx"
const SRC_TESTS = [ SRC, TESTS ]
const SRC = "src/*.jsx";
const TESTS = "test/*.jsx";
const SRC_TESTS = [ SRC, TESTS ];
module.exports = function(gulp, libraryName) {
commonTasks.addTasks(gulp, libraryName, SRC, webpackConfig)
commonTasks.addTasks(gulp, libraryName, SRC, webpackConfig);
gulp.task('test', () =>
gulp.src(TESTS)
@ -17,10 +17,10 @@ module.exports = function(gulp, libraryName) {
.pipe(jasmine({
reporter: new specReporter()
}))
)
);
gulp.task('watch-test', () => {
gulp.run('test')
gulp.run('test');
return gulp.watch(SRC_TESTS, [ 'test' ]);
})
}
});
};

Просмотреть файл

@ -12,6 +12,7 @@
"React"
],
"dependencies": {
"@telerik/eslint-config": "telerik/eslint-config-kendo#master",
"babel-core": "~6",
"babel-loader": "^6.2.0",
"babel-plugin-transform-es2015-modules-umd": "~6",

Просмотреть файл

@ -1,4 +1,4 @@
module.exports = function() {
return '{}'
}
return '{}';
};

Просмотреть файл

@ -1,10 +1,10 @@
const commonTasks = require('kendo-common-tasks')
const path = require('path')
const commonTasks = require('kendo-common-tasks');
const path = require('path');
const sourceExtensions = [ '.jsx' ]
const nodeModulesPath = path.join(__dirname, 'node_modules')
const sourceExtensions = [ '.jsx' ];
const nodeModulesPath = path.join(__dirname, 'node_modules');
const resolve = commonTasks.resolveConfig(sourceExtensions, nodeModulesPath)
const resolve = commonTasks.resolveConfig(sourceExtensions, nodeModulesPath);
const babelLoader = {
test: /\.jsx?$/,
@ -17,7 +17,7 @@ const babelLoader = {
require.resolve('babel-preset-es2015')
]
}
}
};
module.exports = {
CDN: {
@ -79,4 +79,4 @@ module.exports = {
}
} // test
} // module.exports
}; // module.exports