Skip to content

Commit

Permalink
Add shared eslint/prettier configs
Browse files Browse the repository at this point in the history
  • Loading branch information
_hyphen committed Jul 10, 2023
1 parent 29a091a commit c3d9730
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 72 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
root: true,
extends: ["@thesis-co"],
env: {
browser: true,
},
}
78 changes: 15 additions & 63 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# Static site build
public/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
Expand All @@ -23,12 +16,11 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
Expand All @@ -37,81 +29,41 @@ bower_components
# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
# Typescript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next
# dotenv environment variable files
.env*

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
# gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/
public

# TernJS port file
.tern-port
# Mac files
.DS_Store

# Netlify local directory
.netlify
.history/**

# Linaria cache
.linaria-cache

# Mac system files
.DS_Store
# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: local
hooks:
- id: lint-js
name: "lint typescript and javascript"
entry: /usr/bin/env npx eslint
files: '\.jsx?$|\.tsx?$'
language: script
description: "Checks JS/TS code according to the package's linter configuration"
- repo: local
hooks:
- id: lint-config
name: "lint config files"
entry: /usr/bin/env npx prettier -c
files: '\.json$|\.yaml$|\.toml$|\.yml$'
language: script
description: "Checks config files according to the package's linter configuration"
- repo: local
hooks:
- id: lint-docs
name: "lint documentation files"
entry: /usr/bin/env npx prettier -c
files: '\.md$'
language: script
description: "Checks documentation files according to the package's linter configuration"
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cache
package.json
package-lock.json
public
6 changes: 6 additions & 0 deletions .tsconfig-eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"include": [".eslintrc.js", "**/*.js", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}

17 changes: 8 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "esnext",
"jsx": "preserve",
"lib": ["dom", "esnext"],
"declaration": false,
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"jsx": "react-jsx",
"strict": true,
"resolveJsonModule": true,
"noEmit": true,
"isolatedModules": true,
"esModuleInterop": true,
"noUnusedLocals": false,
"baseUrl": "./src"
},
"exclude": ["node_modules", "public", ".cache"]
"noImplicitOverride": true
}
}

0 comments on commit c3d9730

Please sign in to comment.