chore(lint): add linting, fix lint errors
This commit is contained in:
Родитель
e12f91e0a2
Коммит
9b21f5e888
40
.eslintrc
40
.eslintrc
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче