Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

eslint + prettier - jshint #1101

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

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
19 changes: 0 additions & 19 deletions 19 .eslintrc

This file was deleted.

75 changes: 75 additions & 0 deletions 75 .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": [
"airbnb",
"prettier",
"prettier/react"
],
"plugins": [
"react",
"prettier"
],
"rules": {
"no-empty": "warn",
"no-shadow": "warn",
"no-plusplus": "off",
"no-param-reassign": "off",
"no-sequences": "warn",
"no-useless-concat": "warn",
"no-unused-expressions": "warn",
"consistent-return": "off",
"no-underscore-dangle": "off",
"no-nested-ternary": "off",
"no-self-compare": "off",
"no-use-before-define": "warn",
"no-bitwise": "off",
"no-lonely-if": "warn",
"no-var": "off",
"no-else-return": "warn",
"operator-assignment": "warn",
"no-return-assign": "warn",
"no-continue": "off",
"class-methods-use-this": "off",
"one-var": "warn",
"vars-on-top": "off",
"default-case": "off",
"array-callback-return": "off",
"prefer-spread": "off",
"prefer-template": "warn",
"spaced-comment": "warn",
"object-shorthand": "warn",
"prefer-rest-params": "off",
"no-prototype-builtins": "off",
"no-cond-assign": "off",
"no-multi-assign": "off",
"no-unused-vars": "warn",
"constructor-super": "warn",
"block-scoped-var": "warn",
"no-this-before-super": "warn",
"react/sort-comp": "warn",
"react/no-multi-comp": "off",
"react/prop-types": "warn",
"react/prefer-es6-class": "warn",
"react/prefer-stateless-function": "warn",
"react/no-array-index-key": "off",
"react/self-closing-comp": "warn",
"react/jsx-boolean-value": "warn",
"react/jsx-filename-extension": "off",
"import/no-unresolved": "warn",
"import/no-mutable-exports": "warn",
"import/newline-after-import": "warn",
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
"jsx-a11y/no-static-element-interactions": "warn",
"prettier/prettier": [
"warn",
{
"singleQuote": true
}
]
}
}
30 changes: 2 additions & 28 deletions 30 Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,13 @@ var stripCopyright = require('./resources/stripCopyright');

/**
*
* grunt lint Lint all source javascript
* grunt clean Clean dist folder
* grunt build Build dist javascript
* grunt default Lint, Build then Test
* grunt default Build then Test
*
*/
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
asi: true,
curly: false,
eqeqeq: true,
esnext: true,
expr: true,
forin: true,
freeze: false,
immed: true,
indent: 2,
iterator: true,
loopfunc: true,
noarg: true,
node: true,
noempty: true,
nonstandard: true,
trailing: true,
undef: true,
unused: 'vars',
},
all: ['src/**/*.js']
},
clean: {
build: ['dist/*']
},
Expand Down Expand Up @@ -200,12 +176,10 @@ module.exports = function(grunt) {
);
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-release');

grunt.registerTask('lint', 'Lint all source javascript', ['jshint']);
grunt.registerTask('build', 'Build distributed javascript', ['clean', 'bundle', 'copy', 'typedefs']);
grunt.registerTask('default', 'Lint, build.', ['lint', 'build', 'stats']);
grunt.registerTask('default', 'Build.', ['build', 'stats']);
}
39 changes: 3 additions & 36 deletions 39 gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var gulp = require('gulp');
var gutil = require('gulp-util');
var header = require('gulp-header');
var Immutable = require('./');
var jshint = require('gulp-jshint');
var less = require('gulp-less');
var path = require('path');
var React = require('react/addons');
Expand All @@ -19,7 +18,6 @@ var sequence = require('run-sequence');
var size = require('gulp-size');
var source = require('vinyl-source-stream');
var sourcemaps = require('gulp-sourcemaps');
var stylish = require('jshint-stylish');
var through = require('through2');
var uglify = require('gulp-uglify');
var vm = require('vm');
Expand Down Expand Up @@ -69,37 +67,6 @@ gulp.task('typedefs', function() {
fs.writeFileSync(writePath, contents);
});

gulp.task('lint', function() {
return gulp.src('./app/**/*.js')
.pipe(reactTransform())
.on('error', handleError)
.pipe(jshint({
asi: true,
browser: true,
curly: false,
eqeqeq: true,
eqnull: true,
esnext: true,
expr: true,
forin: true,
freeze: true,
immed: true,
indent: 2,
iterator: true,
newcap: false,
noarg: true,
node: true,
noempty: true,
nonstandard: true,
trailing: true,
undef: true,
unused: 'vars',
}))
.pipe(jshint.reporter(stylish))
.pipe(jshint.reporter('fail'))
.on('error', handleError);
});

gulp.task('js', gulpJS(''));
gulp.task('js-docs', gulpJS('docs/'));

Expand Down Expand Up @@ -199,7 +166,7 @@ gulp.task('build', function (done) {
});

gulp.task('default', function (done) {
sequence('clean', 'lint', 'build', done);
sequence('clean', 'build', done);
});

// watch files for changes and reload
Expand All @@ -224,14 +191,14 @@ gulp.task('dev', ['default'], function() {
});

gulp.task('rebuild-js', function (done) {
sequence('lint', 'js', ['pre-render'], function () {
sequence('js', ['pre-render'], function () {
browserSync.reload();
done();
});
});

gulp.task('rebuild-js-docs', function (done) {
sequence('lint', 'js-docs', ['pre-render-docs'], function () {
sequence('js-docs', ['pre-render-docs'], function () {
browserSync.reload();
done();
});
Expand Down
18 changes: 12 additions & 6 deletions 18 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
},
"scripts": {
"build": "grunt default && gulp default",
"lint": "eslint src/ && grunt lint && gulp lint",
"lint": "eslint \"{src,pages/src}/**/*.js\" --quiet",
"lint:warn": "eslint \"{src,pages/src}/**/*.js\"",
"format": "prettier --single-quote --write \"{src,pages/src}/**/*.js\"",
"testonly": "./resources/jest",
"test": "npm run build && npm run lint && npm run testonly && npm run type-check",
"test": "npm run lint && npm run build && npm run testonly && npm run type-check",
"type-check": "cd type-definitions/tests && flow check",
"perf": "node ./resources/bench.js",
"start": "gulp dev",
Expand Down Expand Up @@ -51,7 +53,13 @@
"colors": "1.1.2",
"del": "2.2.2",
"es6-transpiler": "0.7.18",
"eslint": "^1.10.3",
"eslint": "^3.15.0",
"eslint-config-airbnb": "14.1.0",
"eslint-config-prettier": "1.5.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-prettier": "2.0.1",
"eslint-plugin-react": "^6.9.0",
"estraverse": "1.9.3",
"express": "^4.13.4",
"fbjs-scripts": "^0.5.0",
Expand All @@ -60,24 +68,22 @@
"grunt-cli": "1.2.0",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-jshint": "1.1.0",
"grunt-release": "0.14.0",
"gulp": "3.9.1",
"gulp-concat": "2.6.1",
"gulp-filter": "5.0.0",
"gulp-header": "1.8.8",
"gulp-jshint": "2.0.4",
"gulp-less": "3.3.0",
"gulp-size": "2.1.0",
"gulp-sourcemaps": "1.6.0",
"gulp-uglify": "2.0.1",
"gulp-util": "3.0.8",
"jasmine-check": "^0.1.2",
"jest": "^17.0.3",
"jshint-stylish": "^0.4.0",
"magic-string": "0.10.2",
"marked": "0.3.6",
"microtime": "^2.0.0",
"prettier": "0.21.0",
"react": "^0.12.0",
"react-router": "^0.11.2",
"react-tools": "^0.12.0",
Expand Down
9 changes: 9 additions & 0 deletions 9 pages/src/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script"
}
}
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.