This commit is contained in:
crusader 2018-08-26 23:00:34 +09:00
parent 668949d9d0
commit cd96a2ad0e
8 changed files with 5630 additions and 80 deletions

0
CHANGELOG.md Normal file
View File

View File

@ -1,15 +0,0 @@
// @ts-check
/**
* @type {import('./types').PrettierConfig}
*/
const config = {
singleQuote: true,
arrowParens: 'always',
semi: false,
bracketSpacing: true,
trailingComma: 'es5',
printWidth: 80,
}
module.exports = config

View File

@ -29,10 +29,8 @@
"validate-js": "tsc -p ./config && tsc -p ./scripts",
"verify": "yarn validate-js && yarn style && yarn test:ci",
"commit": "git-cz",
"style": "yarn format -- --list-different && yarn lint",
"style": "yarn lint",
"style:fix": "yarn format:fix && yarn lint:fix",
"format": "prettier --config config/prettier.config.js \"**/*.{ts,tsx,js,jsx,css,scss,sass,less,md}\"",
"format:fix": "yarn format -- --write",
"lint": "tslint --project tsconfig.json --format codeFrame",
"lint:fix": "yarn lint -- --fix",
"prerelease": "yarn build",
@ -61,16 +59,6 @@
"pre-push": "yarn style && yarn test -- --bail --onlyChanged"
}
},
"lint-staged": {
"**/*.{ts,tsx,js,jsx,css,scss,sass,less,md}": [
"prettier --config config/prettier.config.js --write",
"git add"
],
"src/**/*.{ts,tsx}": [
"yarn lint:fix",
"git add"
]
},
"peerDependencies": {
"tslib": ">=1.9.0"
},
@ -80,7 +68,6 @@
"@types/jest": "23.3.1",
"@types/json5": "0.0.29",
"@types/node": "10.7.0",
"@types/prettier": "1.13.2",
"@types/webpack-config-utils": "2.3.0",
"awesome-typescript-loader": "5.2.0",
"commitizen": "2.10.1",
@ -92,7 +79,6 @@
"jest-watch-typeahead": "0.2.0",
"json5": "1.0.1",
"lint-staged": "7.2.2",
"prettier": "1.14.2",
"rollup": "0.64.1",
"rollup-plugin-commonjs": "9.1.5",
"rollup-plugin-json": "3.0.0",
@ -108,7 +94,6 @@
"ts-jest": "23.1.3",
"tslib": "1.9.3",
"tslint": "5.11.0",
"tslint-config-prettier": "1.14.0",
"tslint-config-standard": "7.1.0",
"tslint-react": "3.6.0",
"typedoc": "0.11.1",

View File

@ -39,7 +39,6 @@ function createDistPackageJson(packageConfig) {
engines,
config,
husky,
'lint-staged': lintStaged,
...distPackageJson
} = packageConfig

View File

@ -1,12 +1,12 @@
import { IS_DEV } from './environment'
export class Greeter {
constructor(private greeting: string) {}
greet() {
constructor (private greeting: string) {}
greet () {
return `Hello, ${this.greeting}!`
}
greetMe() {
greetMe () {
/* istanbul ignore next line */
if (IS_DEV) {
console.warn('this method is deprecated, use #greet instead')

View File

@ -1,6 +1,6 @@
jest.mock('../environment.ts', () => ({
IS_DEV: true,
IS_PROD: false,
IS_PROD: false
}))
import { Greeter } from '../Greeter'

View File

@ -1,18 +1,8 @@
{
"extends": [
"tslint-config-standard",
"tslint-react",
"tslint-config-prettier"
"tslint-config-standard"
],
"rules": {
// tslint-react rules
"jsx-no-lambda": true,
"jsx-no-string-ref": true,
"jsx-self-close": true,
"jsx-boolean-value": [
true,
"never"
],
// core ts-lint rules
"await-promise": true,
"no-unused-variable": true,
@ -60,37 +50,6 @@
"unified-signatures": true,
"prefer-for-of": true,
"match-default-export-name": true,
"prefer-const": true,
"ban-types": [
true,
[
"Object",
"Avoid using the `Object` type. Did you mean `object`?"
],
[
"Function",
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
],
[
"Boolean",
"Avoid using the `Boolean` type. Did you mean `boolean`?"
],
[
"Number",
"Avoid using the `Number` type. Did you mean `number`?"
],
[
"String",
"Avoid using the `String` type. Did you mean `string`?"
],
[
"Symbol",
"Avoid using the `Symbol` type. Did you mean `symbol`?"
],
[
"Array",
"Avoid using the `Array<T>` type. Use 'type[]' instead."
]
]
"prefer-const": true
}
}
}

5622
yarn.lock Normal file

File diff suppressed because it is too large Load Diff