-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reconfigured linter and prettier and updated code base
- Loading branch information
Showing
42 changed files
with
4,788 additions
and
8,708 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,75 @@ | ||
const copy = require('@neutrinojs/copy') | ||
const standardjs = require('@neutrinojs/standardjs') | ||
const react = require('@neutrinojs/react') | ||
const copy = require('@neutrinojs/copy'); | ||
const react = require('@neutrinojs/react'); | ||
const jest = require('@neutrinojs/jest'); | ||
const eslint = require('@neutrinojs/eslint'); | ||
|
||
module.exports = { | ||
options: { | ||
root: __dirname, | ||
tests: 'src' | ||
tests: 'src', | ||
}, | ||
use: [ | ||
eslint({ | ||
// Uses extensions from neutrino.options.extensions | ||
// test: neutrino.regexFromExtensions(), | ||
include: [], | ||
exclude: [/node_modules/], | ||
eslint: { | ||
baseConfig: { | ||
env: { | ||
es6: true, | ||
browser: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
extends: ['eslint:recommended', 'plugin:react/recommended', 'prettier', 'prettier/react'], | ||
globals: { | ||
process: true, | ||
}, | ||
overrides: [], | ||
parser: require.resolve('babel-eslint'), | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['prettier', 'import'], | ||
root: true, | ||
rules: { | ||
'prettier/prettier': ['error'], | ||
'no-unexpected-multiline': 0, | ||
'no-duplicate-imports': ['error'], | ||
'no-console': 0, | ||
'jsx-a11y/anchor-is-valid': 0, | ||
'jsx-a11y/anchor-has-content': 0, | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: ['builtin', 'external', 'parent', 'sibling', 'index'], | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}), | ||
copy({ | ||
patterns: [ | ||
{ | ||
from: 'src/static', | ||
to: 'static' | ||
} | ||
] | ||
to: 'static', | ||
}, | ||
], | ||
}), | ||
standardjs(), | ||
react({ | ||
html: { | ||
title: 'New Tab', | ||
}, | ||
style: { | ||
test: /\.(css|sass|scss)$/, | ||
loaders: [ | ||
{ loader: 'sass-loader', useId: 'sass' } | ||
] | ||
} | ||
loaders: [{ loader: 'sass-loader', useId: 'sass' }], | ||
}, | ||
}), | ||
jest({ | ||
setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'] | ||
}) | ||
] | ||
setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'], | ||
}), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.history | ||
builds | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"printWidth": 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
const chalk = require('chalk') | ||
const fs = require('fs') | ||
const path = require('path') | ||
const archiver = require('archiver') | ||
const log = console.log | ||
const chalk = require('chalk'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const archiver = require('archiver'); | ||
const log = console.log; | ||
|
||
const browsers = { | ||
chrome: { | ||
name: 'chrome', | ||
labelColor: 'magenta' | ||
labelColor: 'magenta', | ||
}, | ||
firefox: { | ||
name: 'firefox', | ||
labelColor: 'yellow' | ||
} | ||
} | ||
labelColor: 'yellow', | ||
}, | ||
}; | ||
|
||
const getArchive = browser => { | ||
const buildFolderPath = path.resolve(__dirname, `./builds/build_${browser}`) | ||
const getArchive = (browser) => { | ||
const buildFolderPath = path.resolve(__dirname, `./builds/build_${browser}`); | ||
|
||
if (!fs.existsSync(buildFolderPath)) { | ||
log(chalk.yellow(`${browser} build folder NOT found...`)) | ||
return | ||
log(chalk.yellow(`${browser} build folder NOT found...`)); | ||
return; | ||
} | ||
|
||
const chalkLabel = chalk.keyword(`${browsers[browser].labelColor}`) | ||
const label = chalkLabel(browser) | ||
const chalkLabel = chalk.keyword(`${browsers[browser].labelColor}`); | ||
const label = chalkLabel(browser); | ||
|
||
log(label, chalk.green(`${browser} build folder found...`)) | ||
log(label, chalk.green(`${browser} build folder found...`)); | ||
|
||
const zipPath = path.resolve(__dirname, `./builds/${browser}.zip`) | ||
const output = fs.createWriteStream(zipPath) | ||
const zipPath = path.resolve(__dirname, `./builds/${browser}.zip`); | ||
const output = fs.createWriteStream(zipPath); | ||
|
||
const archive = archiver('zip', { | ||
zlib: { level: 9 } | ||
}) | ||
zlib: { level: 9 }, | ||
}); | ||
|
||
output.on('close', () => { | ||
const fileSizeMB = (archive.pointer() / 1048576).toFixed(2) | ||
log(label, chalk.green(`Zip file size: ${fileSizeMB} MB`)) | ||
log(label, 'archiver has been finalized and the output file descriptor has closed.') | ||
}) | ||
const fileSizeMB = (archive.pointer() / 1048576).toFixed(2); | ||
log(label, chalk.green(`Zip file size: ${fileSizeMB} MB`)); | ||
log(label, 'archiver has been finalized and the output file descriptor has closed.'); | ||
}); | ||
|
||
output.on('end', () => log(label, 'Data has been drained')) | ||
output.on('end', () => log(label, 'Data has been drained')); | ||
|
||
archive.on('warning', err => { | ||
archive.on('warning', (err) => { | ||
if (err.code === 'ENOENT') { | ||
log(label, 'EEEEEE') | ||
log(label, 'EEEEEE'); | ||
} else { | ||
throw err | ||
throw err; | ||
} | ||
}) | ||
}); | ||
|
||
archive.on('error', err => { | ||
throw err | ||
}) | ||
archive.on('error', (err) => { | ||
throw err; | ||
}); | ||
|
||
archive.pipe(output) | ||
archive.directory(buildFolderPath, false) | ||
archive.finalize() | ||
} | ||
archive.pipe(output); | ||
archive.directory(buildFolderPath, false); | ||
archive.finalize(); | ||
}; | ||
|
||
getArchive('chrome') | ||
getArchive('firefox') | ||
getArchive('chrome'); | ||
getArchive('firefox'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* eslint-disable no-undef */ | ||
chrome.browserAction.onClicked.addListener(() => { | ||
chrome.tabs.create({ url: 'chrome://newtab' }) | ||
}) | ||
chrome.tabs.create({ url: 'chrome://newtab' }); | ||
}); |
Oops, something went wrong.