Skip to content

Commit

Permalink
IMPROVE: Add ESLint Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Awais committed Dec 31, 2017
1 parent 58529bb commit 252ca86
Show file tree
Hide file tree
Showing 6 changed files with 11,284 additions and 240 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.min.js
**/node_modules/**
**/vendor/**
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true

This comment has been minimized.

Copy link
@dingo-d

dingo-d Jan 16, 2018

node env is true only if you are doing backend (node) stuff, so it will check for the node globals. Not sure it is needed when doing front end development :)

This comment has been minimized.

Copy link
@ahmadawais

ahmadawais Jan 16, 2018

Owner

Yes, you can use that while building packages for Gutenberg.

This comment has been minimized.

Copy link
@dingo-d

dingo-d Jan 17, 2018

Oh, totally forgot about that xD

},
extends: ["eslint:recommended", "wordpress"],
parserOptions: {
sourceType: "module"
},
rules: {
indent: ["error", "tab"],
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "always"]
}
};
97 changes: 48 additions & 49 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,66 @@
*
* In paths you can add <<glob or array of globs>>. Edit the variables as per your project requirements.
*/
module.exports = {

module.exports = {

// START Editing Project Variables.
// Project related.
project : 'WPGulpTheme', // Project Name.
projectURL : 'wpgulp.dev', // Local project URL of your already running WordPress site. Could be something like local.dev or localhost:8888.
productURL : './', // Theme/Plugin URL. Leave it like it is, since our gulpfile.js lives in the root folder.
project: 'WPGulpTheme', // Project Name.
projectURL: 'wpgulp.dev', // Local project URL of your already running WordPress site. Could be something like local.dev or localhost:8888.

This comment has been minimized.

Copy link
@dingo-d

dingo-d Jan 16, 2018

.dev should be replaced to .test, for consistency sake with the #87 PR

This comment has been minimized.

Copy link
@ahmadawais

ahmadawais Jan 16, 2018

Owner

It's already done with .local. you can send a PR with .test in comment next to it if you'd like? 👍

productURL: './', // Theme/Plugin URL. Leave it like it is, since our gulpfile.js lives in the root folder.

// Translation related.
text_domain : 'WPGULP', // Your textdomain here.
translationFile : 'WPGULP.pot', // Name of the transalation file.
translationDestination : './languages', // Where to save the translation files.
packageName : 'WPGULP', // Package name.
bugReport : 'https://AhmadAwais.com/contact/', // Where can users report bugs.
lastTranslator : 'Ahmad Awais <[email protected]>', // Last translator Email ID.
team : 'WPTie <[email protected]>', // Team's Email ID.
textDomain: 'WPGULP', // Your textdomain here.
translationFile: 'WPGULP.pot', // Name of the transalation file.
translationDestination: './languages', // Where to save the translation files.
packageName: 'WPGULP', // Package name.
bugReport: 'https://AhmadAwais.com/contact/', // Where can users report bugs.
lastTranslator: 'Ahmad Awais <[email protected]>', // Last translator Email ID.
team: 'WPTie <[email protected]>', // Team's Email ID.

// Style related.
styleSRC : './assets/css/style.scss', // Path to main .scss file.
styleDestination : './', // Path to place the compiled CSS file.
styleSRC: './assets/css/style.scss', // Path to main .scss file.
styleDestination: './', // Path to place the compiled CSS file.
// Default set to root folder.

// JS Vendor related.
jsVendorSRC : './assets/js/vendor/*.js', // Path to JS vendor folder.
jsVendorDestination : './assets/js/', // Path to place the compiled JS vendors file.
jsVendorFile : 'vendors', // Compiled JS vendors file name.
jsVendorSRC: './assets/js/vendor/*.js', // Path to JS vendor folder.
jsVendorDestination: './assets/js/', // Path to place the compiled JS vendors file.
jsVendorFile: 'vendors', // Compiled JS vendors file name.
// Default set to vendors i.e. vendors.js.

// JS Custom related.
jsCustomSRC : './assets/js/custom/*.js', // Path to JS custom scripts folder.
jsCustomDestination : './assets/js/', // Path to place the compiled JS custom scripts file.
jsCustomFile : 'custom', // Compiled JS custom file name.
jsCustomSRC: './assets/js/custom/*.js', // Path to JS custom scripts folder.
jsCustomDestination: './assets/js/', // Path to place the compiled JS custom scripts file.
jsCustomFile: 'custom', // Compiled JS custom file name.
// Default set to custom i.e. custom.js.

// Images related.
imagesSRC : './assets/img/raw/**/*.{png,jpg,gif,svg}', // Source folder of images which should be optimized.
imagesDestination : './assets/img/', // Destination folder of optimized images. Must be different from the imagesSRC folder.
imagesSRC: './assets/img/raw/**/*.{png,jpg,gif,svg}', // Source folder of images which should be optimized.
imagesDestination: './assets/img/', // Destination folder of optimized images. Must be different from the imagesSRC folder.

// Watch files paths.
styleWatchFiles : './assets/css/**/*.scss', // Path to all *.scss files inside css folder and inside them.
vendorJSWatchFiles : './assets/js/vendor/*.js', // Path to all vendor JS files.
customJSWatchFiles : './assets/js/custom/*.js', // Path to all custom JS files.
projectPHPWatchFiles : './**/*.php', // Path to all PHP files.


styleWatchFiles: './assets/css/**/*.scss', // Path to all *.scss files inside css folder and inside them.
vendorJSWatchFiles: './assets/js/vendor/*.js', // Path to all vendor JS files.
customJSWatchFiles: './assets/js/custom/*.js', // Path to all custom JS files.
projectPHPWatchFiles: './**/*.php', // Path to all PHP files.

// Browsers you care about for autoprefixing.
// Browserlist https ://github.com/ai/browserslist
AUTOPREFIXER_BROWSERS : [
'last 2 version',
'> 1%',
'ie >= 9',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 23',
'ios >= 7',
'android >= 4',
'bb >= 10'
],
AUTOPREFIXER_BROWSERS: [
'last 2 version',
'> 1%',
'ie >= 9',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 23',
'ios >= 7',
'android >= 4',
'bb >= 10'
]

// STOP Editing Project Variables.
};
};
Loading

0 comments on commit 252ca86

Please sign in to comment.