Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #1523

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/js/polyfills.js
114 changes: 114 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"rules": {
"no-empty": [
2,
{
"allowEmptyCatch": true
}
],
"brace-style": [
2,
"1tbs",
{
"allowSingleLine": true
}
],
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": 2,
"no-multi-str": 2,
"no-multi-spaces": 2,
"space-unary-ops": [
2,
{
"words": false,
"nonwords": false
}
],
"key-spacing": [
2,
{
"beforeColon": false,
"afterColon": true
}
],
"no-spaced-func": 2,
"space-before-function-paren": [
2,
"always"
],
"array-bracket-spacing": [
2,
"never",
{
"objectsInArrays": false
}
],
"space-in-parens": [
2,
"never"
],
"comma-dangle": [
2,
"never"
],
"no-trailing-spaces": 2,
"camelcase": [
2,
{
"properties": "never"
}
],
"comma-style": [
2,
"last"
],
"curly": [
2,
"all"
],
"one-var": [
2,
"consecutive"
],
"operator-linebreak": [
2,
"after"
],
"semi": [
2,
"always"
],
"space-infix-ops": 2,
"keyword-spacing": [
2,
{
"overrides": {
"else": {
"before": true
},
"while": {
"before": true
},
"catch": {
"before": true
}
}
}
],
"space-before-blocks": [
2,
"always"
],
"indent": [
2,
4,
{
"SwitchCase": 1
}
],
"quotes": [
2,
"single"
]
}
}
134 changes: 0 additions & 134 deletions .jscsrc

This file was deleted.

5 changes: 5 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
demo/
dist/
spec/vendor/*.js
src/js/polyfills.js
index.js
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"sub": true,
"undef": true,
"unused": true,
"validthis": true
"validthis": true,
"esversion": 6
}
4 changes: 4 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"rules": {
}
}
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ To help create consistent looking code throughout the project, we use a few tool

We use [JSHint](http://jshint.com/) on each build to find easy-to-catch errors and potential problems in our js. You can find our JSHint settings in the `.jshintrc` file in the root of the project.

#### jscs
#### ESLint

We use [jscs](http://jscs.info/) on each build to enforce some code style rules we have for our project. You can find our jscs settings in the `.jscsrc` file in the root of the project.
We use [ESLint](https://eslint.org/) on each build to enforce some code style rules we have for our project. You can find our ESLint settings in the `.eslintrc` file in the root of the project.

#### EditorConfig

Expand All @@ -48,8 +48,8 @@ grunt
These are the other available grunt tasks:

* __js__: runs jslint and jasmine tests and creates minified and concatenated versions of the script;
* __css__: runs autoprefixer and csslint
* __test__: runs jasmine tests, jslint and csslint
* __css__: runs autoprefixer and stylelint
* __test__: runs jasmine tests, jslint and stylelint
* __watch__: watch for modifications on script/scss files
* __spec__: runs a task against a specified file

Expand Down
41 changes: 14 additions & 27 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ module.exports = function (grunt) {
// TODO: build check with debug and devel false
gruntConfig.jshint = {
options: {
ignores: ['src/js/polyfills.js'],
jshintrc: true,
reporter: require('jshint-stylish')
},
Expand All @@ -106,16 +105,14 @@ module.exports = function (grunt) {
}
};

// TODO: "maximumLineLength": 120
gruntConfig.jscs = {
gruntConfig.eslint = {
src: [
'src/js/**/*.js',
'spec/*.spec.js',
'Gruntfile.js',
'!src/js/polyfills.js'
'Gruntfile.js'
],
options: {
config: '.jscsrc'
config: '.eslintrc'
}
};

Expand All @@ -126,7 +123,7 @@ module.exports = function (grunt) {
specs: ['spec/*.spec.js'],
helpers: 'spec/helpers/*.js',
vendor: [
'node_modules/lodash/index.js',
'node_modules/lodash/lodash.js',
'spec/vendor/jasmine-jsreporter.js',
'spec/vendor/jasmine-jsreporter-script.js'
],
Expand Down Expand Up @@ -172,20 +169,10 @@ module.exports = function (grunt) {
}
};

gruntConfig.csslint = {
ksorv marked this conversation as resolved.
Show resolved Hide resolved
strict: {
options: {
'box-sizing': false,
'compatible-vendor-prefixes': false,
'fallback-colors': false,
'gradients': false,
'important': false,
'import': 2,
'outline-none': false,
'adjoining-classes': false
},
src: 'dist/css/**/*.css'
}
gruntConfig.stylelint = {
all: [
'dist/css/**/*.css'
]
};

gruntConfig.sass = {
Expand Down Expand Up @@ -333,16 +320,16 @@ module.exports = function (grunt) {
});

if (parseInt(process.env.TRAVIS_PULL_REQUEST, 10) > 0) {
grunt.registerTask('travis', ['jshint', 'jscs', 'jasmine:suite', 'csslint', 'coveralls']);
grunt.registerTask('travis', ['jshint', 'eslint', 'jasmine:suite', 'stylelint', 'coveralls']);
} else {
grunt.registerTask('travis', ['connect', 'jshint', 'jscs', 'jasmine:suite', 'csslint', 'saucelabs-jasmine', 'coveralls']);
grunt.registerTask('travis', ['connect', 'jshint', 'eslint', 'jasmine:suite', 'stylelint', 'saucelabs-jasmine', 'coveralls']);
}

grunt.registerTask('test', ['jshint', 'jscs', 'concat', 'jasmine:suite', 'csslint']);
grunt.registerTask('test', ['jshint', 'eslint', 'concat', 'jasmine:suite', 'stylelint']);
grunt.registerTask('sauce', ['connect', 'saucelabs-jasmine']);
grunt.registerTask('js', ['jshint', 'jscs', 'concat', 'jasmine:suite', 'uglify']);
grunt.registerTask('css', ['sass', 'autoprefixer', 'cssmin', 'csslint']);
grunt.registerTask('default', ['js', 'css']);
grunt.registerTask('js', ['jshint', 'eslint', 'concat', 'jasmine:suite', 'uglify']);
grunt.registerTask('css', ['sass', 'autoprefixer', 'cssmin', 'stylelint']);
grunt.registerTask('default', ['css', 'js']);

grunt.registerTask('spec', 'Runs a task on a specified file', function (taskName, fileName) {
globalConfig.file = fileName;
Expand Down
2 changes: 0 additions & 2 deletions OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ var editor = new MediumEditor('.editable', {
hideDelay: 500,
previewValueSelector: 'a'
}
}
});
```

Expand Down Expand Up @@ -435,7 +434,6 @@ var editor = new MediumEditor('.editable', {
targetCheckbox: false,
targetCheckboxText: 'Open in new window'
}
}
});
```

Expand Down
Loading