Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
845 changes: 832 additions & 13 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
83 changes: 83 additions & 0 deletions packages/js-dash-sdk/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// A set of rules to easen misuse in the existing codebase
// We should fix these warnigns when possible
const warnRules = {
'import/prefer-default-export': 'warn',
'no-param-reassign': 'warn',
'import/no-cycle': 'warn',
'import/no-named-default': 'warn',
'import/no-named-as-default': 'warn',
};

// A set of common rules applicable to both JS and TS files
const commonRules = {
'no-await-in-loop': 'off',
};

module.exports = {
extends: [
'airbnb-base',
],
root: true,
env: {
node: true,
mocha: true,
},
rules: {
...warnRules,
...commonRules,
},
overrides: [
// TypeScript
{
files: [
'**/*.ts',
],
extends: [
'airbnb-base',
'airbnb-typescript/base',
],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/return-await': 'warn',
...warnRules,
...commonRules,
},
},
// TypeScript tests
{
files: [
'src/**/*.spec.ts',
'src/test/**/*.ts',
'tests/**/*.ts',
],
rules: {
// Ignore dirty-chai errors
'@typescript-eslint/no-unused-expressions': 0,
// Ignore require('dev-dependency') errors for tests and mocks
'import/no-extraneous-dependencies': 0,
},
},
// JS tests
{
files: [
'src/test/**/*.js',
'tests/**/*.js',
'*.config.js',
],
rules: {
// Ignore dirty-chai errors
'no-unused-expressions': 0,
// Ignore require('dev-dependency') errors for tests and mocks
'import/no-extraneous-dependencies': 0,
},
},
],
ignorePatterns: [
// TODO: why do we have d.ts files in typescript project at all?
'*.d.ts',
'build',
'dist',
],
};
4 changes: 3 additions & 1 deletion packages/js-dash-sdk/build-utils/ws.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-disable no-undef */

/**
* WebSocket shim for webpack browser builds
*/

var ws;
let ws;

if (typeof WebSocket !== 'undefined') {
ws = WebSocket;
Expand Down
5 changes: 2 additions & 3 deletions packages/js-dash-sdk/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
const webpack = require('webpack');
const dotenvResult = require('dotenv-safe').config();

const webpackBaseConfig = require("./webpack.base.config");

const karmaMocha = require('karma-mocha');
const karmaMochaReporter = require('karma-mocha-reporter');
const karmaChai = require('karma-chai');
const karmaChromeLauncher = require('karma-chrome-launcher');
const karmaWebpack = require('karma-webpack');
const webpackBaseConfig = require('./webpack.base.config');

if (dotenvResult.error) {
throw dotenvResult.error;
Expand Down Expand Up @@ -42,7 +41,7 @@ module.exports = (config) => {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: [ 'chromeWithoutSecurity'],
browsers: ['chromeWithoutSecurity'],
singleRun: false,
concurrency: Infinity,
browserNoActivityTimeout: 7 * 60 * 1000, // 30000 default
Expand Down
9 changes: 8 additions & 1 deletion packages/js-dash-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"start:ts": "tsc --watch",
"build": "yarn run build:ts && webpack --stats-error-details",
"build:ts": "tsc",
"lint": "",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "yarn run test:unit && yarn run test:functional && yarn run test:browsers",
"test:browsers": "karma start ./karma.conf.js --single-run",
"test:unit": "TS_NODE_COMPILER_OPTIONS={\"target\":\"es6\"} ts-mocha \"src/**/*.spec.ts\"",
Expand Down Expand Up @@ -55,6 +56,8 @@
"@types/node": "^14.6.0",
"@types/sinon": "^9.0.4",
"@types/sinon-chai": "^3.2.4",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"assert": "^2.0.0",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
Expand All @@ -63,6 +66,10 @@
"crypto-browserify": "^3.12.0",
"dirty-chai": "^2.0.1",
"dotenv-safe": "^8.2.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "^2.24.2",
"events": "^3.3.0",
"https-browserify": "^1.0.0",
"karma": "^6.4.1",
Expand Down
Loading