Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhosny committed Aug 20, 2024
1 parent a58ad09 commit c9faa7f
Show file tree
Hide file tree
Showing 14 changed files with 1,792 additions and 2,219 deletions.
3,817 changes: 1,690 additions & 2,127 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
"fix": "run-s fix:*",
"fix:prettier": "prettier src --ignore-path .eslintignore --write",
"fix:eslint": "eslint --fix --ext js,jsx,ts,tsx src",
"fix:stylelint": "stylelint --fix \"src/*\"",
"fix:stylelint": "stylelint --fix \"src/**/*.{css,scss}\"",
"fix:stylelint-website": "stylelint --fix \"website/**/*.{css,scss}\"",
"test": "run-s test:*",
"test:unit": "jest src",
"test:lint": "run-s lint:*",
"test:bundlewatch": "bundlewatch --config .bundlewatch.config.json",
"lint:prettier": "prettier src --ignore-path .eslintignore --list-different",
"lint:eslint": "eslint --ext js,jsx,ts,tsx src",
"lint:stylelint": "stylelint \"src/*\"",
"lint:stylelint": "stylelint \"src/**/*.{css,scss}\"",
"lint:stylelint-website": "stylelint \"website/**/*.{css,scss}\"",
"postinstall": "cd website && npm install",
"reset": "git clean -dfx && git reset --hard && npm i",
Expand Down Expand Up @@ -78,8 +78,9 @@
"nodemon": "2.0.20",
"npm-run-all": "4.1.5",
"postcss": "8.4.31",
"postcss-cli": "11.0.0",
"prettier": "2.8.8",
"postcss-cli": "9.1.0",
"postcss-scss": "4.0.9",
"prettier": "3.2.5",
"recursive-fs": "2.1.0",
"sass": "1.49.7",
"stylelint": "14.5.0",
Expand Down
24 changes: 12 additions & 12 deletions src/lib/css/dark.theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ __selector__ text.title {
}

__selector__ text.subTitle {
fill: #cccccc;
fill: #ccc;
}

__selector__ text.dateCounterText {
fill: #cccccc;
fill: #ccc;
opacity: 1;
}

__selector__ text.caption {
fill: #cccccc;
fill: #ccc;
}

__selector__ .halo {
fill: #313639;
opacity: 1;
stroke: #313639;
stroke-width: 10;
stroke-linejoin: round;
opacity: 1;
stroke-width: 10;
}

__selector__ text.legend-text {
Expand All @@ -44,29 +44,29 @@ __selector__ text.valueLabel {
}

__selector__ .tick text {
fill: #cccccc;
fill: #ccc;
}

__selector__ .tick line {
shape-rendering: CrispEdges;
stroke: #dddddd;
stroke: #ddd;
}

__selector__ .tick line.origin {
stroke: #aaaaaa;
stroke: #aaa;
}

__selector__ .controls div,
__selector__ .overlay div {
color: #ffffff;
background: #777777;
background: #777;
border: 1px solid black;
color: #fff;
opacity: 0.5;
}

__selector__ .controls div:hover,
__selector__ .overlay div:hover {
background: #aaaaaa;
background: #aaa;
color: black;
}

Expand All @@ -81,6 +81,6 @@ __selector__ .highlight {

__selector__ .selected {
fill: #d12020 !important;
stroke: #777777 !important;
stroke: #777 !important;
stroke-width: 1 !important;
}
36 changes: 18 additions & 18 deletions src/lib/css/light.theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,66 @@ __selector__ text.title {
*/

__selector__ text.subTitle {
fill: #777777;
fill: #777;
}

__selector__ text.dateCounterText {
fill: #bbbbbb;
fill: #bbb;
opacity: 1;
}

__selector__ text.caption {
fill: #777777;
fill: #777;
}

__selector__ .halo {
fill: #ffffff;
stroke: #ffffff;
stroke-width: 10;
stroke-linejoin: round;
fill: #fff;
opacity: 1;
stroke: #fff;
stroke-linejoin: round;
stroke-width: 10;
}

__selector__ text.legend-text {
fill: #000000;
fill: #000;
}

__selector__ text.label {
fill: #000000;
fill: #000;
}

__selector__ text.label.outside-bars {
fill: #000000;
fill: #000;
}

__selector__ text.valueLabel {
fill: #000000;
fill: #000;
}

__selector__ .tick text {
fill: #777777;
fill: #777;
}

__selector__ .tick line {
shape-rendering: CrispEdges;
stroke: #dddddd;
stroke: #ddd;
}

__selector__ .tick line.origin {
stroke: #aaaaaa;
stroke: #aaa;
}

__selector__ .controls div,
__selector__ .overlay div {
color: #ffffff;
background: #777777;
background: #777;
border: 1px solid black;
color: #fff;
opacity: 0.5;
}

__selector__ .controls div:hover,
__selector__ .overlay div:hover {
background: #aaaaaa;
background: #aaa;
color: black;
}

Expand All @@ -83,6 +83,6 @@ __selector__ .highlight {

__selector__ .selected {
fill: #d12020 !important;
stroke: #777777 !important;
stroke: #777 !important;
stroke-width: 1 !important;
}
50 changes: 28 additions & 22 deletions src/lib/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
__selector__ text {
font-family:
Open Sans,
sans-serif;
font-size: 16px;
font-family: Open Sans, sans-serif;
}

__selector__ text.title {
Expand All @@ -13,16 +15,18 @@ __selector__ text.subTitle {
}

__selector__ text.caption {
font-weight: 400;
font-size: 24px;
font-weight: 400;
}

__selector__ text.legend-text {
user-select: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
user-select: none;
user-select: none;
user-select: none;
}

__selector__ text.label {
font-weight: 600;
}
Expand Down Expand Up @@ -59,45 +63,47 @@ __selector__ .controls {

__selector__ .controls div,
__selector__ .overlay div {
border-radius: 5px;
border-radius: 5px;
border-radius: 5px;
cursor: pointer;
font-size: 24px;
font-weight: 700;
width: 38px;
height: 38px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
margin: 5px;
text-align: center;
width: 38px;
}

__selector__ .controls svg {
height: 28px;
margin: 5px auto;
width: 28px;
height: 28px;
}

__selector__ .overlay {
align-items: center;
display: flex;
height: 100%;
justify-content: center;
left: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}

__selector__ .overlay div {
position: relative;
display: flex;
align-items: center;
border-radius: 100px;
border-radius: 100px;
border-radius: 100px;
display: flex;
height: 200px;
justify-content: center;
position: relative;
width: 200px;
height: 200px;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
border-radius: 100px;
}

__selector__ .overlay svg {
height: 50%;
width: 50%;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/options/options.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export const optionsReducer: Reducer<Options, OptionsAction> = (state = defaultO
const colorMap = Array.isArray(options.colorMap)
? [...options.colorMap].map(String)
: typeof options.colorMap === 'object'
? { ...options.colorMap }
: state.colorMap;
? { ...options.colorMap }
: state.colorMap;

const topN = fixedOrder.length || Number(options.topN) || state.topN;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/ticker/__tests__/ticker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('ticker', () => {
},
}),
dispatch: mockDispatch,
} as unknown as Store);
}) as unknown as Store;

beforeEach(() => {
justStarted = true;
Expand Down
8 changes: 4 additions & 4 deletions src/lib/ticker/ticker.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export const tickerReducer: Reducer<TickerState, TickerAction> = (state = initia
dates.indexOf(state.currentDate) !== -1
? state.currentDate
: state.currentDate < dates[0]
? dates[0]
: state.currentDate > dates[dates.length - 1]
? dates[dates.length - 1]
: dates[[...dates, state.currentDate].sort().indexOf(state.currentDate)];
? dates[0]
: state.currentDate > dates[dates.length - 1]
? dates[dates.length - 1]
: dates[[...dates, state.currentDate].sort().indexOf(state.currentDate)];
return {
...state,
currentDate,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/__tests__/data/get-date-slice.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('dates#getDateSlice', () => {
},
}),
dispatch: mockDispatch,
} as unknown as Store);
}) as unknown as Store;

test('getDateSlice', () => {
const date = '1985-01-01';
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils/__tests__/utils/get-color.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('utils#getColor', () => {
},
};
},
} as unknown as Store);
}) as unknown as Store;

const dataDefaults = {
name: 'a',
Expand All @@ -40,7 +40,7 @@ describe('utils#getColor', () => {
({
...dataDefaults,
...data,
} as Data);
}) as Data;

test('uses data.color', () => {
const data = makeDataObj({ color: 'red' });
Expand Down
27 changes: 15 additions & 12 deletions website/docs/gallery/slider.module.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
.slider_container {
width: 90%;
margin: 20px auto;
width: 90%;
}

.slider {
-webkit-appearance: none;
width: 100%;
height: 15px;
border-radius: 5px;
appearance: none;
background: #dedddd;
border-radius: 5px;
height: 15px;
outline: none;
width: 100%;
}

.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
border-radius: 50%;
appearance: none;
background: var(--ifm-color-primary-light);
border-radius: 50%;
cursor: pointer;
height: 25px;
width: 25px;
}

.slider::-moz-range-thumb {
width: 25px;
height: 25px;
border-radius: 50%;
background: var(--ifm-color-primary-light);
border-radius: 50%;
cursor: pointer;
height: 25px;
width: 25px;
}
Loading

0 comments on commit c9faa7f

Please sign in to comment.