Skip to content

Commit

Permalink
CI: setup lint
Browse files Browse the repository at this point in the history
  • Loading branch information
echoulen committed Oct 4, 2018
1 parent 47e0b1d commit 838b2b4
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
.idea
coverage
yarn-error.log
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"clean": "rimraf dist",
"build": "npm run clean && tsc -p .",
"pretest": "tslint -p .",
"test": "jest",
"prepare": "npm run build"
},
Expand Down Expand Up @@ -34,6 +35,7 @@
"sinon": "^6.2.0",
"styled-components": "^3.3.2",
"ts-jest": "^23.1.4",
"tslint": "^5.11.0",
"typescript": "^2.9.2"
},
"peerDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions src/Themes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Theme} from "./types/Theme";
export interface ThemeProps {
channel: any;
api: any;
active: Boolean;
active: boolean;
}

interface ThemeState {
Expand All @@ -25,13 +25,13 @@ type BaseComponentProps = ThemeProps & ThemeState & ThemeHandler;

const BaseComponent: React.SFC<BaseComponentProps> = ({onSelectTheme, themes, theme, active}) => (
active ? (
<div style={RowStyle}>
{themes.map((th, i) => {
const buttonStyle = th === theme ? SelectedButtonStyle : ButtonStyle;
return <div style={buttonStyle} key={i} onClick={() => onSelectTheme(th)}>{th.name}</div>;
}).toArray()}
</div> )
: (<div />)
<div style={RowStyle}>
{themes.map((th, i) => {
const buttonStyle = th === theme ? SelectedButtonStyle : ButtonStyle;
return <div style={buttonStyle} key={i} onClick={() => onSelectTheme(th)}>{th.name}</div>;
}).toArray()}
</div>
) : (<div />)
);

export const Themes = compose<BaseComponentProps, ThemeProps>(
Expand Down
2 changes: 1 addition & 1 deletion src/withThemesProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {List} from "immutable";
import * as React from "react";
import {makeDecorator} from '@storybook/addons';
import {makeDecorator} from "@storybook/addons";
import {ThemesProvider} from "./ThemesProvider";
import {Theme} from "./types/Theme";

Expand Down
42 changes: 42 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"extends": [
"tslint:latest"
],
"rules": {
"max-line-length": [
true,
150
],
"no-submodule-imports": false,
"no-empty-interface": false,
"no-console": false,
"no-var-requires": false,
"no-unused-expression": false,
"no-bitwise": false,
"no-implicit-dependencies": false,
"no-conditional-assignment": false,
"triple-equals": false,
"interface-name": false,
"object-literal-sort-keys": false,
"object-literal-key-quotes": [true, "as-needed"],
"prefer-object-spread": false,
"jsx-no-multiline-js": false,
"ordered-imports": false,
"member-ordering": [
true,
{
"order": [
"private-static-field",
"public-static-field",
"public-instance-field",
"public-constructor",
"private-instance-field",
"private-constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
]
}
}
43 changes: 40 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ aws4@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"

babel-code-frame@^6.26.0:
babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
dependencies:
Expand Down Expand Up @@ -476,7 +476,7 @@ buffer@^5.0.3:
base64-js "^1.0.2"
ieee754 "^1.1.4"

builtin-modules@^1.0.0:
builtin-modules@^1.0.0, builtin-modules@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"

Expand Down Expand Up @@ -522,7 +522,7 @@ chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@^2.0.0, chalk@^2.0.1:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
dependencies:
Expand Down Expand Up @@ -609,6 +609,10 @@ [email protected], combined-stream@~1.0.6:
dependencies:
delayed-stream "~1.0.0"

commander@^2.12.1:
version "2.18.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970"

commander@~2.17.1:
version "2.17.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
Expand Down Expand Up @@ -3054,6 +3058,12 @@ [email protected]:
version "1.1.7"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"

resolve@^1.3.2:
version "1.8.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26"
dependencies:
path-parse "^1.0.5"

ret@~0.1.10:
version "0.1.15"
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
Expand Down Expand Up @@ -3511,6 +3521,33 @@ ts-jest@^23.1.4:
json5 "^0.5.0"
lodash "^4.17.10"

tslib@^1.8.0, tslib@^1.8.1:
version "1.9.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"

tslint@^5.11.0:
version "5.11.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed"
dependencies:
babel-code-frame "^6.22.0"
builtin-modules "^1.1.1"
chalk "^2.3.0"
commander "^2.12.1"
diff "^3.2.0"
glob "^7.1.1"
js-yaml "^3.7.0"
minimatch "^3.0.4"
resolve "^1.3.2"
semver "^5.3.0"
tslib "^1.8.0"
tsutils "^2.27.2"

tsutils@^2.27.2:
version "2.29.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
dependencies:
tslib "^1.8.1"

tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
Expand Down

0 comments on commit 838b2b4

Please sign in to comment.