Skip to content

Commit f4965fa

Browse files
authored
Merge pull request #410 from mashmatrix/update-latest-lib
Update libs to latest
2 parents f776dba + d4bed28 commit f4965fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+55781
-61021
lines changed

.circleci/config.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@ version: 2.1
22

33
defaults: &defaults
44
docker:
5-
- image: regviz/node-xcb
5+
- image: cimg/node:16.14.2-browsers
66
working_directory: ~/project
77

8+
orbs:
9+
browser-tools: circleci/[email protected]
10+
811
jobs:
912
install:
1013
<<: *defaults
1114
steps:
1215
- checkout
1316
- restore_cache:
1417
keys:
15-
- yarn-lock-{{ checksum "yarn.lock" }}
16-
- yarn-cache-{{ checksum "yarn.lock" }}
18+
- yarn-lock-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
19+
- yarn-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
1720
- run:
1821
name: Environemnt Variable Check
1922
command: |
@@ -27,11 +30,11 @@ jobs:
2730
name: Install Dependencies
2831
command: yarn install
2932
- save_cache:
30-
key: yarn-lock-{{ checksum "yarn.lock" }}
33+
key: yarn-lock-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
3134
paths:
3235
- node_modules
3336
- save_cache:
34-
key: yarn-cache-{{ checksum "yarn.lock" }}
37+
key: yarn-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
3538
paths:
3639
- /usr/local/share/.cache/yarn
3740
- persist_to_workspace:
@@ -83,6 +86,8 @@ jobs:
8386
test_visual:
8487
<<: *defaults
8588
steps:
89+
- browser-tools/install-chrome
90+
- browser-tools/install-chromedriver
8691
- attach_workspace:
8792
at: ~/
8893
- run:

.eslintrc.js

Lines changed: 24 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
module.exports = {
22
'parser': '@typescript-eslint/parser',
33
'extends': [
4-
'airbnb',
5-
'plugin:prettier/recommended',
6-
'prettier/react',
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
7+
'plugin:react/recommended',
8+
'prettier',
79
],
810
'plugins': [
911
'@typescript-eslint',
12+
'jsx-a11y',
1013
],
1114
'parserOptions': {
1215
'sourceType': 'module',
@@ -16,61 +19,23 @@ module.exports = {
1619
'browser': true
1720
},
1821
'rules': {
19-
'no-nested-ternary': 0,
20-
'react/no-multi-comp': 0,
21-
'react/jsx-no-bind': 0,
22-
'react/jsx-filename-extension': [1, { 'extensions': ['.js', '.jsx', '.ts', '.tsx'] }],
23-
'jsx-a11y/no-static-element-interactions': 0,
24-
'class-methods-use-this': 0,
25-
'react/no-unused-prop-types': 1,
26-
'react/prop-types': 0,
27-
'import/no-extraneous-dependencies': ['error', {
28-
devDependencies: true,
29-
}],
30-
'import/no-unresolved': 0,
31-
'import/named': 0,
32-
33-
'jsx-a11y/label-has-for': 0,
34-
35-
'no-await-in-loop': 0,
36-
'no-restricted-syntax': [2,
37-
{
38-
'selector': 'ForInStatement',
39-
'message': 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.'
40-
},
41-
{
42-
'selector': 'LabeledStatement',
43-
'message': 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.'
44-
},
45-
{
46-
'selector': 'WithStatement',
47-
'message': '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.'
48-
}
49-
],
50-
'no-return-assign': [2, 'except-parens'],
51-
'import/no-cycle': 0,
52-
53-
// TODO: Fix or disable
54-
'react/require-default-props': 1,
55-
'react/destructuring-assignment': 0,
56-
'react/no-find-dom-node': 1,
57-
'react/no-array-index-key': 2,
58-
'react/button-has-type': 2,
59-
'jsx-a11y/click-events-have-key-events': 1,
60-
'jsx-a11y/no-noninteractive-tabindex': 2,
61-
'jsx-a11y/role-has-required-aria-props': 2,
62-
'jsx-a11y/anchor-is-valid': 1,
63-
'jsx-a11y/interactive-supports-focus': 2,
64-
'jsx-a11y/label-has-associated-control': [2, { assert: 'either' }],
65-
66-
// For TypeScript
67-
'camelcase': 0,
68-
'@typescript-eslint/camelcase': 2,
69-
'no-array-constructor': 0,
70-
'@typescript-eslint/no-array-constructor': 2,
71-
'no-unused-vars': 0,
72-
'@typescript-eslint/no-unused-vars': 2,
73-
74-
'@typescript-eslint/no-unnecessary-type-assertion': 2,
22+
// temp disabled - start
23+
'@typescript-eslint/no-explicit-any': 1,
24+
'@typescript-eslint/no-unsafe-assignment': 1,
25+
'@typescript-eslint/no-unsafe-argument': 1,
26+
'@typescript-eslint/no-unsafe-member-access': 1,
27+
'@typescript-eslint/no-unsafe-call': 1,
28+
'@typescript-eslint/no-unsafe-return': 1,
29+
'@typescript-eslint/ban-ts-comment': 1,
30+
'@typescript-eslint/ban-types': 1,
31+
'@typescript-eslint/restrict-template-expressions': 1,
32+
'@typescript-eslint/unbound-method': 1,
33+
'@typescript-eslint/no-non-null-assertion': 1,
34+
'@typescript-eslint/restrict-plus-operands': 1,
35+
'@typescript-eslint/no-empty-function': 1,
36+
'react/prop-types': 1,
37+
'react/display-name': 1,
38+
'react/no-deprecated': 1,
39+
// tmp disabled - end
7540
}
7641
};

.storybook/addons.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

.storybook/config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

.storybook/infoAddonDefaults.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

.storybook/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
stories: ['../stories/**/*Stories.tsx'],
5+
addons: [
6+
'@storybook/addon-docs',
7+
'@storybook/addon-actions',
8+
'@storybook/addon-knobs',
9+
'storycap',
10+
],
11+
};

.storybook/preview-head.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<script>
22
(function() {
33
var stylesheetUrl =
4-
(/\.sbook\.io$/.test(location.hostname) ? "//mashmatrix.github.io/react-lightning-design-system" :
5-
location.hostname === "mashmatrix.github.io" ? "/react-lightning-design-system" :
6-
"") +
4+
(location.hostname === "mashmatrix.github.io" ? "/react-lightning-design-system" : "") +
75
"/assets/styles/salesforce-lightning-design-system.min.css";
86
var link = document.createElement('link');
97
link.href = stylesheetUrl;
@@ -15,10 +13,4 @@
1513
html {
1614
background: #fff;
1715
}
18-
.content-wrapper {
19-
padding: 16px;
20-
}
21-
.content-wrapper > div > div:nth-child(2) {
22-
padding: 16px;
23-
}
2416
</style>

.storybook/preview.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import 'core-js/stable';
2+
import { withScreenshot } from 'storycap';
3+
import wrapSLDS from './wrapSLDS';
4+
5+
let assetRoot;
6+
if (typeof location !== 'undefined' && location.hostname === 'mashmatrix.github.io') {
7+
assetRoot = '//mashmatrix.github.io/react-lightning-design-system/assets';
8+
}
9+
10+
const withSLDS = wrapSLDS({ assetRoot });
11+
12+
export const decorators = [
13+
withScreenshot,
14+
withSLDS,
15+
];
16+
17+
export const parameters = {
18+
// Global parameter is optional.
19+
screenshot: {
20+
// Put global screenshot parameters(e.g. viewport)
21+
},
22+
};

.storybook/webpack.config.js

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React from 'react';
2-
import classnames from 'classnames';
32
import { ComponentSettings } from '../src/scripts';
43

5-
export default function wrapContent(options) {
4+
export default function wrapSLDS(options) {
65
return story => (
76
<ComponentSettings assetRoot={ options.assetRoot } portalClassName='slds'>
8-
<div className={ classnames('content-wrapper', options.className) }>{ story() }</div>
7+
{story()}
98
</ComponentSettings>
109
);
1110
}

0 commit comments

Comments
 (0)