17 Commits

Author SHA1 Message Date
Kent C. Dodds
28545516e3 support eslint with typescript 2019-11-12 17:38:47 -07:00
Kent C. Dodds
b0d4378a07 add typescript 2019-11-12 17:37:54 -07:00
Kent C. Dodds
e88f4ba7af SETUP FOR TYPESCRIPT 2019-11-12 17:36:47 -07:00
Kent C. Dodds
650e66fe3f prettier --list-different 2019-11-12 17:36:05 -07:00
Kent C. Dodds
544df8b178 setup eslint-config-prettier 2019-11-12 17:35:22 -07:00
Kent C. Dodds
4fa1a97129 config prettier 2019-11-12 17:33:03 -07:00
Kent C. Dodds
fbb81df6c9 install and run prettier 2019-11-12 17:32:53 -07:00
Kent C. Dodds
fb1aa446f5 scripting eslint 2019-11-12 17:30:23 -07:00
Kent C. Dodds
b6add202df eslint extends 2019-11-12 17:22:47 -07:00
Kent C. Dodds
544746d064 eslint: config 2019-11-12 17:22:31 -07:00
Kent C. Dodds
d0c1fa44e4 init 2019-11-12 17:19:31 -07:00
Kent C. Dodds
cd5939daf8 I think this is it 2019-07-31 20:24:08 -06:00
Kent C. Dodds
cc722afcb2 progress 2019-07-31 20:20:48 -06:00
Kent C. Dodds
571fc946b8 some progress made 2019-07-31 17:10:32 -06:00
Kent C. Dodds
898876d0d2 fix husky 2019-07-31 12:54:29 -06:00
Kent C. Dodds
9c51bd92fa improve things 2019-07-31 12:53:54 -06:00
Kent C. Dodds
f10cfb98ce progress 2019-07-31 12:51:37 -06:00
64 changed files with 4297 additions and 11190 deletions

13
.babelrc Normal file
View File

@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "10"
}
}
],
"@babel/preset-typescript"
]
}

31
.eslintrc Normal file
View File

@@ -0,0 +1,31 @@
{
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"extends": ["eslint:recommended", "eslint-config-prettier"],
"rules": {
"strict": ["error", "never"]
},
"env": {
"browser": true
},
"overrides": [
{
"files": "**/*.+(ts|tsx)",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint/eslint-plugin"],
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"eslint-config-prettier/@typescript-eslint"
]
}
]
}

View File

@@ -1 +1,2 @@
node_modules node_modules
dist

View File

@@ -1,9 +1,14 @@
{ {
"arrowParens": "avoid", "arrowParens": "avoid",
"bracketSpacing": false, "bracketSpacing": false,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false, "jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80, "printWidth": 80,
"proseWrap": "always", "proseWrap": "always",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": false, "semi": false,
"singleQuote": true, "singleQuote": true,
"tabWidth": 2, "tabWidth": 2,

View File

@@ -1,12 +0,0 @@
{
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended"],
"rules": {
"no-console": "off"
},
"env": {
"browser": true
}
}

View File

@@ -1 +0,0 @@
node_modules

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
{
"name": "static-testing-tools",
"version": "1.0.0",
"description": "",
"main": "src/example.js",
"scripts": {
"lint": "eslint src"
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"eslint": "^5.5.0"
}
}

View File

@@ -1,11 +0,0 @@
const name = 'Freddy'
typeof name === 'string'
if (!('serviceWorker' in navigator)) {
// you have an old browser :-(
}
const greeting = 'hello'
console.log(`${greeting} world!`)
;[(1, 2, 3)].forEach(x => console.log(x))

View File

@@ -1,12 +0,0 @@
{
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended"],
"rules": {
"no-console": "off"
},
"env": {
"browser": true
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +0,0 @@
{
"name": "static-testing-tools",
"version": "1.0.0",
"description": "",
"main": "src/example.js",
"scripts": {
"lint": "eslint src",
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\""
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"eslint": "^5.5.0",
"prettier": "^1.14.2"
}
}

View File

@@ -1,11 +0,0 @@
const name = "Freddy";
typeof name === "string";
if (!("serviceWorker" in navigator)) {
// you have an old browser :-(
}
const greeting = "hello";
console.log(`${greeting} world!`);
[(1, 2, 3)].forEach(x => console.log(x));

View File

@@ -1,12 +0,0 @@
{
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended"],
"rules": {
"no-console": "off"
},
"env": {
"browser": true
}
}

View File

@@ -1 +0,0 @@
node_modules

View File

@@ -1,7 +0,0 @@
node_modules
coverage
dist
build
.build
# etc...

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +0,0 @@
{
"name": "static-testing-tools",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint src",
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\""
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"eslint": "^5.5.0",
"prettier": "^1.14.2"
}
}

View File

@@ -1,12 +0,0 @@
{
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended", "eslint-config-prettier"],
"rules": {
"no-console": "off"
},
"env": {
"browser": true
}
}

View File

@@ -1,7 +0,0 @@
node_modules
coverage
dist
build
.build
# etc...

View File

@@ -1,12 +0,0 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"printWidth": 80,
"proseWrap": "always",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}

View File

@@ -1,18 +0,0 @@
{
"name": "static-testing-tools",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint src",
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\""
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"eslint": "^5.5.0",
"eslint-config-prettier": "^3.0.1",
"prettier": "^1.14.2"
}
}

View File

@@ -1,11 +0,0 @@
const name = 'Freddy'
typeof name === 'string'
if (!('serviceWorker' in navigator)) {
// you have an old browser :-(
}
const greeting = 'hello'
console.log(`${greeting} world!`)
;[(1, 2, 3)].forEach(x => console.log(x))

View File

@@ -1,12 +0,0 @@
{
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended", "eslint-config-prettier"],
"rules": {
"no-console": "off"
},
"env": {
"browser": true
}
}

View File

@@ -1 +0,0 @@
node_modules

View File

@@ -1,7 +0,0 @@
node_modules
coverage
dist
build
.build
# etc...

View File

@@ -1,12 +0,0 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"printWidth": 80,
"proseWrap": "always",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +0,0 @@
{
"name": "static-testing-tools",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint src",
"format": "npm run prettier -- --write",
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
"validate": "npm run lint && npm run prettier -- --list-different"
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"eslint": "^5.5.0",
"eslint-config-prettier": "^3.0.1",
"prettier": "^1.14.2"
}
}

View File

@@ -1,11 +0,0 @@
const name = 'Freddy'
typeof name === 'string'
if (!('serviceWorker' in navigator)) {
// you have an old browser :-(
}
const greeting = 'hello'
console.log(`${greeting} world!`)
;[(1, 2, 3)].forEach(x => console.log(x))

View File

@@ -1,13 +0,0 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended", "eslint-config-prettier"],
"rules": {
"no-console": "off"
},
"env": {
"browser": true
}
}

View File

@@ -1,11 +0,0 @@
[ignore]
[include]
[libs]
[lints]
[options]
[strict]

View File

@@ -1 +0,0 @@
node_modules

View File

@@ -1,7 +0,0 @@
node_modules
coverage
dist
build
.build
# etc...

View File

@@ -1,12 +0,0 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"printWidth": 80,
"proseWrap": "always",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +0,0 @@
{
"name": "static-testing-tools",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint src",
"flow": "flow",
"format": "npm run prettier -- --write",
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow"
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"babel-eslint": "^9.0.0",
"eslint": "^5.5.0",
"eslint-config-prettier": "^3.0.1",
"flow-bin": "^0.81.0",
"prettier": "^1.14.2"
}
}

View File

@@ -1,10 +0,0 @@
const name = 'Freddy'
typeof name === 'string'
if (!('serviceWorker' in navigator)) {
// you have an old browser :-(
}
const greeting = 'hello'
console.log(`${greeting} world!`)
;[(1, 2, 3)].forEach(x => console.log(x))

View File

@@ -1,22 +0,0 @@
// @flow
function add(a: number, b: number): number {
return a + b
}
type User = {
name: {
first: string,
middle: string,
last: string,
},
}
function getFullName(user: User): string {
const {
name: {first, middle, last},
} = user
return [first, middle, last].filter(Boolean).join('')
}
add(1, 2)
getFullName({name: {first: 'Joe', middle: 'Bud', last: 'Matthews'}})

View File

@@ -1,13 +0,0 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended", "eslint-config-prettier"],
"rules": {
"no-console": "off"
},
"env": {
"browser": true
}
}

View File

@@ -1,11 +0,0 @@
[ignore]
[include]
[libs]
[lints]
[options]
[strict]

View File

@@ -1 +0,0 @@
node_modules

View File

@@ -1,7 +0,0 @@
node_modules
coverage
dist
build
.build
# etc...

View File

@@ -1,12 +0,0 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"printWidth": 80,
"proseWrap": "always",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}

View File

@@ -1,25 +0,0 @@
{
"name": "static-testing-tools",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint src",
"flow": "flow",
"format": "npm run prettier -- --write",
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow",
"precommit": "npm run validate"
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"babel-eslint": "^9.0.0",
"eslint": "^5.5.0",
"eslint-config-prettier": "^3.0.1",
"flow-bin": "^0.81.0",
"husky": "^0.14.3",
"prettier": "^1.14.2"
}
}

View File

@@ -1,10 +0,0 @@
const name = 'Freddy'
typeof name === 'string'
if (!('serviceWorker' in navigator)) {
// you have an old browser :-(
}
const greeting = 'hello'
console.log(`${greeting} world!`)
;[(1, 2, 3)].forEach(x => console.log(x))

View File

@@ -1,13 +0,0 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended", "eslint-config-prettier"],
"rules": {
"no-console": "off"
},
"env": {
"browser": true
}
}

View File

@@ -1,11 +0,0 @@
[ignore]
[include]
[libs]
[lints]
[options]
[strict]

View File

@@ -1,11 +0,0 @@
{
"linters": {
"*.js": [
"eslint"
],
"*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)": [
"prettier --write",
"git add"
]
}
}

View File

@@ -1,7 +0,0 @@
node_modules
coverage
dist
build
.build
# etc...

View File

@@ -1,12 +0,0 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"printWidth": 80,
"proseWrap": "always",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}

View File

@@ -1,26 +0,0 @@
{
"name": "static-testing-tools",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint src",
"flow": "flow",
"format": "npm run prettier -- --write",
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow",
"precommit": "lint-staged && npm run flow"
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"babel-eslint": "^9.0.0",
"eslint": "^5.5.0",
"eslint-config-prettier": "^3.0.1",
"flow-bin": "^0.81.0",
"husky": "^0.14.3",
"lint-staged": "^7.2.2",
"prettier": "^1.14.2"
}
}

View File

@@ -1,10 +0,0 @@
const name = 'Freddy'
typeof name === 'string'
if (!('serviceWorker' in navigator)) {
// you have an old browser :-(
}
const greeting = 'hello'
console.log(`${greeting} world!`)
;[(1, 2, 3)].forEach(x => console.log(x))

View File

@@ -1,22 +0,0 @@
// @flow
function add(a: number, b: number): number {
return a + b
}
type User = {
name: {
first: string,
middle: string,
last: string,
},
}
function getFullName(user: User): string {
const {
name: {first, middle, last},
} = user
return [first, middle, last].filter(Boolean).join('')
}
add(1, 2)
getFullName({name: {first: 'Joe', middle: 'Bud', last: 'Matthews'}})

4206
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

27
package.json Normal file
View File

@@ -0,0 +1,27 @@
{
"name": "static-testing-tools",
"private": true,
"author": "Kent C. Dodds (http://kentcdodds.com/)",
"license": "GPLv3",
"scripts": {
"build": "babel src --extensions .js,.ts,.tsx --out-dir dist",
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
"check-types": "tsc",
"prettier": "prettier --ignore-path .gitignore \"**/*.+(js|json|ts|tsx)\"",
"format": "npm run prettier -- --write",
"check-format": "npm run prettier -- --list-different",
"validate": "npm run check-types && npm run check-format && npm run lint && npm run build"
},
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/preset-typescript": "^7.7.2",
"@typescript-eslint/eslint-plugin": "^2.7.0",
"@typescript-eslint/parser": "^2.7.0",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.5.0",
"prettier": "^1.19.1",
"typescript": "^3.7.2"
}
}

View File

@@ -1,5 +1,5 @@
const name = 'Freddy' const username = 'freddy'
typeof name === 'string' typeof username === 'string'
if (!('serviceWorker' in navigator)) { if (!('serviceWorker' in navigator)) {
// you have an old browser :-( // you have an old browser :-(
@@ -7,5 +7,4 @@ if (!('serviceWorker' in navigator)) {
const greeting = 'hello' const greeting = 'hello'
console.log(`${greeting} world!`) console.log(`${greeting} world!`)
;[1, 2, 3].forEach(x => console.log(x))
;[(1, 2, 3)].forEach(x => console.log(x))

View File

@@ -1,14 +1,13 @@
// @flow
function add(a: number, b: number): number { function add(a: number, b: number): number {
return a + b return a + b
} }
type User = { interface User {
name: { name: {
first: string, first: string
middle: string, middle: string
last: string, last: string
}, }
} }
function getFullName(user: User): string { function getFullName(user: User): string {
const { const {

6
tsconfig.json Normal file
View File

@@ -0,0 +1,6 @@
{
"compilerOptions": {
"noEmit": true,
"baseUrl": "./src"
}
}