Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
[wip] Add linting and make pass
Browse files Browse the repository at this point in the history
Add linting according to the eslint kartotherian rules.
Only test node version 6. Version 4 is fairly old, and does not
support the linting rules (mainly the trailing comma pieces)
and Mapnik only supports up to node 6.9.4 for now.
  • Loading branch information
mooeypoo authored and nyurik committed Mar 21, 2018
1 parent 08b01e5 commit 00c695a
Show file tree
Hide file tree
Showing 20 changed files with 965 additions and 1,003 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
extends: 'kartotherian',
env: {
node: true,
es6: true,
browser: false,
},
rules: {
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
// Dangling commas are unsupported in node
functions: 'never',
},
],
},
};
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ language: node_js
sudo: false

node_js:
- "0.10"
- "0.12"
- "4"
- "6"
- "node"

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libgif-dev
32 changes: 32 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* eslint-env node */
module.exports = function Gruntfile(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-mocha-test');

grunt.initConfig({
eslint: {
code: {
src: [
'**/*.js',
'!node_modules/**',
'!vendor/**',
'!lib/**',
'!coverage/**',
],
},
},
mochaTest: {
test: {
options: {
reporter: 'spec',
},
src: ['test/**/*.js'],
},
},
});

grunt.registerTask('lint', 'eslint');
grunt.registerTask('test', ['lint', 'mochaTest']);
grunt.registerTask('default', 'test');
};
Loading

0 comments on commit 00c695a

Please sign in to comment.