Skip to content

Commit

Permalink
chore: setup eslint with workflow (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Jun 11, 2021
1 parent 7ab8342 commit 2f7ce5d
Show file tree
Hide file tree
Showing 13 changed files with 3,839 additions and 1,217 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/dist/
/docs/
raphael.min.js
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
amd: true,
},
extends: ["standard", "plugin:prettier/recommended"],
parserOptions: {
ecmaVersion: 12,
},
rules: {},
};
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build

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

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
- run: npm install
- run: npm run build
- run: npm run lint
86 changes: 42 additions & 44 deletions GruntFile.js
Original file line number Diff line number Diff line change
@@ -1,59 +1,57 @@
module.exports = function (grunt) {
require("matchdep").filterAll("grunt-*").forEach(grunt.loadNpmTasks);

require('matchdep').filterAll("grunt-*").forEach(grunt.loadNpmTasks);

grunt.initConfig({

copy: {
js: {
expand: true,
cwd: './',
src: 'justgage.js',
dest: 'dist/'
}
grunt.initConfig({
copy: {
js: {
expand: true,
cwd: "./",
src: "justgage.js",
dest: "dist/",
},

},

// jshint: {
// files: [
// 'Gruntfile.js',
// 'src/js/*.js'
// ],

// options: {
// globals: {
// console: true
// }
// }
// },

uglify: {
options: {
mangle: true,
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
},
sourceMap: true,
sourceMapName: 'dist/justgage.min.js.map',
preserveComments: 'some'

uglify: {
options: {
mangle: true,
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true,
},
js: {
files: {
'dist/justgage.min.js': ['./justgage.js']
}
}
}
});

grunt.registerTask('build', [
// 'jshint',
'copy',
'uglify',
]);
};
sourceMap: true,
sourceMapName: "dist/justgage.min.js.map",
preserveComments: "some",
},
js: {
files: {
"dist/justgage.min.js": ["./justgage.js"],
},
},
},
});

grunt.registerTask("build", [
// 'jshint',
"copy",
"uglify",
]);
};
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

[![Downloads](https://img.shields.io/npm/dm/justgage.svg)](https://www.npmjs.com/package/justgage)

[![Build](https://github.com/toorshia/justgage/actions/workflows/build.yml/badge.svg)](https://github.com/toorshia/justgage/actions/workflows/build.yml)

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.png?v=103)](https://opensource.org/licenses/mit-license.php)

Expand Down
Loading

0 comments on commit 2f7ce5d

Please sign in to comment.