Skip to content

Commit

Permalink
Merge pull request processing#490 from processing/lint-prettier
Browse files Browse the repository at this point in the history
eslint and prettier: lint everything
  • Loading branch information
endurance21 authored May 15, 2020
2 parents 8c35cce + 12e89b3 commit f620932
Show file tree
Hide file tree
Showing 65 changed files with 2,275 additions and 1,931 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Gruntfile.js
test/test.js
webpack.config.js
lib/
68 changes: 12 additions & 56 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,67 +13,23 @@
"Float32Array": true,
"Uint8Array": true
},
"extends": ["eslint:recommended", "prettier"],
"plugins": ["prettier"],
"rules": {
"block-scoped-var": 0,
"camelcase": 0,
"comma-style": [
2,
"last"
],
"dot-notation": [
"prettier/prettier": ["error"],
"no-cond-assign": [2, "except-parens"],
"eqeqeq": ["error", "smart"],
"no-use-before-define": [
2,
{
"allowKeywords": true
"functions": false
}
],
"eqeqeq": [
2,
"allow-null"
],
"eol-last": ["error", "always"],
"guard-for-in": 2,
"indent": ["error", 2, { "SwitchCase": 1 }],
"max-len": [1, 120, 2, { "ignoreComments": true }],
"new-cap": 2,
"new-cap": 0,
"no-caller": 2,
"no-cond-assign": [
2,
"except-parens"
],
"no-debugger": 2,
"no-empty": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-parens": 2,
"no-extra-semi": 2,
"no-irregular-whitespace": 2,
"no-trailing-spaces": 2,
"no-iterator": 2,
"no-loop-func": 0,
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1 }],
"no-multi-str": 2,
"no-new": 2,
"no-plusplus": 0,
"no-proto": 2,
"no-script-url": 2,
"no-sequences": 2,
"no-shadow": 2,
"no-undef": 2,
"no-unused-vars": 2,
"no-with": 2,
"quotes": [
2,
"single"
],
"semi": [
2
],
"space-before-blocks": "error",
"strict": 2,
"valid-typeof": 2,
"wrap-iife": [
2,
"inside"
]
"no-undef": 0,
"no-unused-vars": ["error", { "args": "none" }],
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-console": "off"
}
}
28 changes: 28 additions & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Gruntfile.js
webpack.config.js
lib/
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
9 changes: 6 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ module.exports = function(grunt) {
// Configure style consistency
eslint: {
source: {
options: {configFile: './.eslintrc'},
options: {
configFile: './.eslintrc',
fix: true
},
src: ['src/**/*.js', 'test/tests/**/*.js']
}
},
Expand Down Expand Up @@ -56,7 +59,7 @@ module.exports = function(grunt) {
}
});


grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-connect');
Expand All @@ -65,7 +68,7 @@ module.exports = function(grunt) {

grunt.registerTask('lint', ['eslint:source']);
grunt.registerTask('default', ['webpack:prod', 'decomment']);
grunt.registerTask('dev', ['connect','webpack:dev', 'decomment']);
grunt.registerTask('dev', ['eslint','connect','webpack:dev', 'decomment']);
grunt.registerTask('serve', 'connect:server:keepalive');
grunt.registerTask('run-tests', ['serve', 'open']);
};
51 changes: 51 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"amdclean": "~2.0",
"babel-loader": "^8.0.6",
"babel-plugin-preval": "^3.0.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"grunt": "~0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-connect": "^1.0.2",
Expand All @@ -21,7 +23,9 @@
"grunt-mocha": "^1.0.4",
"grunt-open": "^0.2.3",
"grunt-webpack": "^3.1.3",
"prettier": "2.0.5",
"raw-loader": "^3.0.0",
"tslint-config-prettier": "^1.18.0",
"uglify-loader": "^3.0.0",
"uglifyjs-webpack-plugin": "^2.1.3",
"webpack": "^4.33.0",
Expand Down
Loading

0 comments on commit f620932

Please sign in to comment.