1.0.7 • Published 8 years ago

eslint-config-ess v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

###Source Github: https://github.com/estrat/eslint-config-ess
NPM: https://www.npmjs.com/package/eslint-config-ess

###Install npm install --save eslint-config-ess

###Grunt Configuration 1. Install grunt-eslint:

npm install --save-dev grunt-eslint
  1. Create a new file in the grunt tasks folder, e.g. grunts/eslint.js.

    mkdir -p grunts;
    touch grunts/eslint.js
  2. In this file, paste this code to register a grunt task:

    'use strict';
    
    module.exports = function(grunt) {
    
    	grunt.config('eslint', {
    		options: {
    			rulePaths: ['node_modules/eslint-config-ess/rules']
    		},
    
    		backend: {
    			options: {
    				config: 'eslint-config-ess/configs/backend.js'
    			},
    			src: [
    				//file patterns here
    			]
    		},
    
    		frontend: {
    			options: {
    				config: 'eslint-config-ess/configs/frontend.js'
    			},
    			src: [
    				//file patterns here
    			]
    		}
    	});
    
    	grunt.loadNpmTasks('grunt-eslint');
    
    };
  3. Fill out the backend.src and frontend.src arrays.

  4. Update gruntfile.js to include this configuration:

    'use strict';
    
    var Pkg = require('./package.json');
    
    module.exports = function(grunt) {
    
    	grunt.initConfig({
    		pkg: Pkg
    	});
    
    	grunt.loadTasks('grunts');
    	
    	grunt.registerTask('check', [
    		'eslint'
    	]);
    	
    	grunt.registerTask('lint', [
    		'eslint'
    	]);
    	
    	grunt.registerTask('build', [
    		'check'
    		//additional tasks here
    	]);
    	
    	grunt.registerTask('default', [
    		'check'
    	]);
    };
  5. Test with grunt and grunt check.

###Sublime Text Configuration NOTE: This is a secondary helper; it will not catch as many errors as the grunt task above will. 1. Install Package Control if not already. 2. Open Package Control (⌘⇧P or CTRL+SHIFT+P). 3. Select Package Control: Install Package. 4. Install ESLint. 5. Repeat steps 2-3 and install SublimeLinter-contrib-eslint. 6. Create .eslintrc.js in the top-level directory of the repo (next to package.json):
touch .eslintrc.js 7. Insert this code into .eslintrc.js (this will check only backend errors):

```
'use strict';

function clone(obj) {
	return JSON.parse(JSON.stringify(obj));
}

var config = clone(require('eslint-config-ess').configs.backend);
if (config.rules['lowercase-require']) delete config.rules['lowercase-require'];
module.exports = config;
```
1.0.7

8 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago