Skip to content

Commit 71e995d

Browse files
committed
Initialize TS project with ESLint and Prettier
0 parents  commit 71e995d

14 files changed

+1885
-0
lines changed

β€Ž.eslintrc.jsβ€Ž

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
},
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:react/recommended',
9+
'plugin:import/errors',
10+
'plugin:import/warnings',
11+
'plugin:@typescript-eslint/eslint-recommended',
12+
'plugin:prettier/recommended',
13+
'prettier',
14+
],
15+
globals: {
16+
Atomics: 'readonly',
17+
SharedArrayBuffer: 'readonly',
18+
},
19+
parser: '@typescript-eslint/parser',
20+
parserOptions: {
21+
ecmaFeatures: {
22+
jsx: true,
23+
},
24+
ecmaVersion: 2018,
25+
sourceType: 'module',
26+
},
27+
plugins: ['react', 'import', '@typescript-eslint', 'prettier'],
28+
rules: {
29+
quotes: ['warn', 'single', { allowTemplateLiterals: true }],
30+
'no-console': 'warn',
31+
'no-unused-vars': 'warn',
32+
'no-prototype-builtins': 'off',
33+
'sort-imports': [
34+
'error',
35+
{
36+
ignoreCase: false,
37+
ignoreDeclarationSort: true,
38+
ignoreMemberSort: true,
39+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
40+
},
41+
],
42+
'react/prop-types': 'off',
43+
'react/display-name': 'off',
44+
'import/first': 'error',
45+
'import/no-unresolved': 'off',
46+
'import/no-namespace': 'error',
47+
'import/no-duplicates': 'error',
48+
'import/no-default-export': 'error',
49+
'import/no-internal-modules': 'off',
50+
'import/newline-after-import': 'error',
51+
'import/order': [
52+
'error',
53+
{
54+
groups: ['builtin', 'external', 'parent', 'index', 'sibling'],
55+
},
56+
],
57+
'@typescript-eslint/no-unused-vars': 'error',
58+
'@typescript-eslint/explicit-member-accessibility': 'error',
59+
'prettier/prettier': 'off',
60+
},
61+
settings: {
62+
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
63+
},
64+
};

β€Ž.gitignoreβ€Ž

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# JetBrains IDEs, Vim Swap files
2+
.idea/
3+
*.swp
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# Diagnostic reports (https://nodejs.org/api/report.html)
14+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
15+
16+
# Runtime data
17+
pids
18+
*.pid
19+
*.seed
20+
*.pid.lock
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
*.lcov
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
38+
# node-waf configuration
39+
.lock-wscript
40+
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
42+
build/Release
43+
44+
# Dependency directories
45+
node_modules/
46+
jspm_packages/
47+
48+
# TypeScript v1 declaration files
49+
typings/
50+
51+
# TypeScript cache
52+
*.tsbuildinfo
53+
54+
# Optional npm cache directory
55+
.npm
56+
57+
# Optional eslint cache
58+
.eslintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variables file
76+
.env
77+
.env.test
78+
79+
# parcel-bundler cache (https://parceljs.org/)
80+
.cache
81+
82+
# Next.js build output
83+
.next
84+
85+
# Nuxt.js build / generate output
86+
.nuxt
87+
dist
88+
89+
# Gatsby files
90+
.cache/
91+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
92+
# https://nextjs.org/blog/next-9-1#public-directory-support
93+
# public
94+
95+
# vuepress build output
96+
.vuepress/dist
97+
98+
# Serverless directories
99+
.serverless/
100+
101+
# FuseBox cache
102+
.fusebox/
103+
104+
# DynamoDB Local files
105+
.dynamodb/
106+
107+
# TernJS port file
108+
.tern-port

β€Ž.prettierrc.jsβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
trailingComma: 'es5',
3+
tabWidth: 4,
4+
semi: true,
5+
singleQuote: true,
6+
useTabs: false,
7+
printWidth: 120,
8+
};

β€Žlib/ContextMenuWrapper.d.tsβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from 'react';
2+
interface ContextMenuWrapperProps {
3+
id?: string;
4+
}
5+
export declare const ContextMenuWrapper: React.FC<ContextMenuWrapperProps>;
6+
export {};

β€Žlib/ContextMenuWrapper.jsβ€Ž

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žlib/ContextMenuWrapper.js.mapβ€Ž

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žlib/index.d.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { ContextMenuWrapper } from './ContextMenuWrapper';

β€Žlib/index.jsβ€Ž

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žlib/index.js.mapβ€Ž

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)