Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NPM Dependencies #405

Merged
merged 5 commits into from Jul 2, 2019
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

This file was deleted.

@@ -12,3 +12,10 @@ app/content-scripts/vendor/

## Precompiled
app/templates/
build/
cliqz/
dist/
docs/

## Node Modules
node_modules/
@@ -0,0 +1,89 @@
/**
* ESLint Config
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2019 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

module.exports = {
env: {
browser: true,
es6: true,
commonjs: true,
jest: true
},
extends: 'airbnb',
globals: {
chrome: true,
t: true,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'react',
],
// 0 = off, 1 = warn, 2 = error
rules: {
'camelcase': [0],
'class-methods-use-this': [0],
'comma-dangle': [2, {
'arrays': 'only-multiline',
'objects': 'only-multiline',
'functions': 'ignore'
}],
'func-names': [0],
'indent': [1, 'tab', {
'SwitchCase': 1
}],
'lines-between-class-members': [1],
'max-len': [0],
'newline-per-chained-call': [0, { 'ignoreChainWithDepth': 2 }],
'no-mixed-operators': [0],
'no-nested-ternary': [0],
'no-param-reassign': [0], // TODO: enable this check
'no-plusplus': [0],
'no-prototype-builtins': [0], // TODO: enable this check
'no-restricted-syntax': [0], // TODO: enable this check
'no-tabs': [0],
'no-underscore-dangle': [0],
'no-unused-vars': [1],
'no-useless-escape': [1],
'operator-linebreak': [0],
'space-before-function-paren': [2, 'never'],

// Plugin: Import
'import/no-cycle': [0],
'import/prefer-default-export': [0],

// Plugin: React
'react/destructuring-assignment': [0],
'react/jsx-indent': [1, 'tab'],
'react/jsx-indent-props': [1, 'tab'],
'react/no-access-state-in-setstate': [0], // TODO: enable this check
'react/no-danger': [0],
'react/prop-types': [0],

// Plugin: JSX-A11y
'jsx-a11y/alt-text': [0],
'jsx-a11y/anchor-is-valid': [0],
'jsx-a11y/click-events-have-key-events': [0],
'jsx-a11y/label-has-for': [0],
'jsx-a11y/mouse-events-have-key-events': [0],
'jsx-a11y/no-noninteractive-element-interactions': [0],
'jsx-a11y/no-static-element-interactions': [0],
},
};

This file was deleted.

@@ -1,8 +1,6 @@
## Build Files
dist/
build/
web-ext-artifacts/
*precompiled/
licenses.json

## Node
@@ -11,5 +11,5 @@ install:

script:
- node ./tools/licenses/fetchLicenses.js
- yarn run lint
- yarn run test.unit
- yarn lint
- yarn test.unit
@@ -1,6 +1,6 @@
# Ghostery CODEOWNERS
# Each line is a file pattern followed by one or more owners,
# the last matching pattern has the most precendence.
# the last matching pattern has the most precedence.

# Core Ghostery team
* @ghostery/ghostery
@@ -24,14 +24,10 @@
# Shared Components
/app/shared-components @IAmThePan

# Rewards
/app/content-scripts/rewards/ @trickpattyFH20
/app/panel/components/Rewards.jsx @trickpattyFH20
/src/classes/Rewards.js @trickpattyFH20

# Build Tools
webpack.config.js @trickpattyFH20
.eslintrc.json @trickpattyFH20
.eslintrc.js @christophertino
babel.config.js @christophertino
webpack.config.js @christophertino

# Unit Tests
/test/ @IAmThePan
@@ -36,17 +36,17 @@ $ yarn upgrade
## Building
```sh
# Build all sources
$ yarn run build.dev
$ yarn build.dev
```

```sh
# Build for production
$ yarn run build.prod
$ yarn build.prod
```

```sh
# Build and watch for changes
$ yarn run build.watch
$ yarn build.watch
```

## Enable Debugging / Logging
@@ -57,33 +57,40 @@ $ yarn run build.watch
```

## Testing and Linting
```sh
# Update Jest snapshot artifacts
$ yarn test.snapshot
```

```sh
# Run unit tests
$ yarn run test.unit
$ yarn test.unit
```

```sh
# Run linter over the ./app and ./src folders
$ yarn run lint
$ yarn lint
```

```sh
# Lint a specific file
$ yarn run lint.raw -- src/utils/matcher.js
$ yarn lint.raw src/utils/matcher.js
```

```sh
# Disable lint
$ NO_LINT=true yarn run build.dev
# Test i18n string lengths for panel UI
$ yarn leet
# Reset back to original en language file
$ yarn leet.reset
```

## Build Docs
```sh
# Build JSDoc files to ./docs
$ yarn run docs
$ yarn docs
```

## Translating Files
## Internationalization
We use Transifex and their CLI to manage our translation files. Follow
[these instructions](https://docs.transifex.com/client/installing-the-client)
to get started.
@@ -162,15 +169,7 @@ See [CONTRIBUTING](CONTRIBUTING.md) and [CODE OF CONDUCT](CODE-OF-CONDUCT.md)
+ [Ghostery Lite for Safari](https://github.com/ghostery/GhosterySafari)

## Ghostery Team
Ghostery relies on [contributions](https://github.com/ghostery/ghostery-extension/graphs/contributors) from lots of talented people. Our core development team looks like this:

![Christopher Tino](https://static.cliqz.com/wp-content/uploads/2017/08/chris.jpg) | ![José María Signanini](https://static.cliqz.com/wp-content/uploads/2017/08/jose.jpg) | ![Serge Zarembsky](https://static.cliqz.com/wp-content/uploads/2017/08/serge.jpg) | ![Patrick Lawler](https://static.cliqz.com/wp-content/uploads/2017/08/patrick.jpg) | ![Caleb Richelson](https://static.cliqz.com/wp-content/uploads/2018/03/caleb.jpg)
:---:|:---:|:---:|:---:|:---:
[Christopher Tino](http://github.com/christophertino) | [José María Signanini](https://github.com/jsignanini) | [Serge Zarembsky](https://github.com/zarembsky) | [Patrick Lawler](https://github.com/trickpattyFH20) | [Caleb Richelson](https://github.com/IAmThePan)
![Aziz Aithsaine](https://static.cliqz.com/wp-content/uploads/2017/08/aziz.jpg) | ![Ethan Gooding](https://static.cliqz.com/wp-content/uploads/2018/12/Ethan.jpg) | ![Frank Chiarulli](https://static.cliqz.com/wp-content/uploads/2018/12/Frank-Chiarulli.jpg) | ![Ilya Zarembsky](https://static.cliqz.com/wp-content/uploads/2018/12/Ilya-Zarembsky.jpg) | ![Valmik Patel](https://static.cliqz.com/wp-content/uploads/2018/07/Valmik.jpg)
Aziz Aithsaine | [Ethan Gooding](https://github.com/Eden12345) | [Frank Chiarulli](https://github.com/fcjr) | [Ilya Zarembsky](https://github.com/wlycdgr) | [Valmik Patel](https://github.com/valmikkpatel)

See the full montage of uncommonly attractive Ghosterians/Cliqzers [here](https://www.cliqz.com/about/team).
Ghostery relies on [contributions](https://github.com/ghostery/ghostery-extension/graphs/contributors) from lots of talented people. See the full montage of uncommonly attractive Ghosterians/Cliqzers [here](https://www.cliqz.com/about/team).

## License
[MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/) Copyright 2019 Ghostery, Inc. All rights reserved.
@@ -21,7 +21,7 @@ import {
} from '../AccountConstants';

// Fake the translation function to only return the translation key
global.t = function (str) {
global.t = function(str) {
return str;
};

@@ -24,7 +24,7 @@ const { sendMessage } = msg;
* Use to call init to initialize functionality
* @var {Object} initialized to an object with init method as its property
*/
const AccountPagesContentScript = (function (window) {
const AccountPagesContentScript = (function(window) {
/**
* Initialize functionality of this script.
* @memberOf AccountPagesContentScript
@@ -37,7 +37,7 @@ const AccountPagesContentScript = (function (window) {
'accountPage.getUserSubscriptionData',
'accountPage.logout',
];
const _initialize = function () {
const _initialize = function() {
_listeners.forEach(name => window.addEventListener(name, () => sendMessage(name)));
};

@@ -25,7 +25,7 @@ const { onMessage } = chrome.runtime;
* Use to call init function and initialize Click2PlayContentScript functionality.
* @var {Object} initialized with an object with exported init as its property
*/
const Click2PlayContentScript = (function (win, doc) {
const Click2PlayContentScript = (function(win, doc) {
const C2P_DATA = {};
/**
* Create element for the specified html tag
@@ -35,7 +35,7 @@ const Click2PlayContentScript = (function (win, doc) {
* @param {string} type html tag
* @return {Object} DOM element
*/
const createEl = function (type) {
const createEl = function(type) {
return doc.createElement(type);
};
/**
@@ -46,7 +46,7 @@ const Click2PlayContentScript = (function (win, doc) {
* @param {Object} parent parent DOM element
* @param {...Object} args children DOM element(s)
*/
const appendChild = function (parent, ...args) {
const appendChild = function(parent, ...args) {
for (let i = 0; i < args.length; i++) {
parent.appendChild(args[i]);
}
@@ -63,7 +63,7 @@ const Click2PlayContentScript = (function (win, doc) {
* @param {Object} c2pAppDef replacement data
* @param {string} html a fragment of html to be used in replacement.
*/
const buildC2P = function (c2pFrame, c2pAppDef, html) {
const buildC2P = function(c2pFrame, c2pAppDef, html) {
c2pFrame.addEventListener('load', () => {
const idoc = c2pFrame.contentDocument;

@@ -122,7 +122,7 @@ const Click2PlayContentScript = (function (win, doc) {
* @param {Object} c2p_app an array with replacement data
* @param {string} html a fragment of html to be used in replacement.
*/
const applyC2P = function (app_id, c2p_app, html) {
const applyC2P = function(app_id, c2p_app, html) {
c2p_app.forEach((c2pAppDef, idx) => {
const els = doc.querySelectorAll(c2pAppDef.ele);
for (let i = 0, num_els = els.length; i < num_els; i++) {
@@ -155,7 +155,7 @@ const Click2PlayContentScript = (function (win, doc) {
* @memberof Click2PlayContentScript
* @package
*/
const _initialize = function () {
const _initialize = function() {
onMessage.addListener((request, sender, sendResponse) => {
if (request.source === 'cliqz-content-script') {
return false;
ProTip! Use n and p to navigate between commits in a pull request.