Skip to content

Commit e3c9bd2

Browse files
committed
Add eslint-config-typescript
1 parent e96674d commit e3c9bd2

20 files changed

+6460
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 2
5+
indent_style = space
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.{ts,js,json}]
11+
charset = utf-8
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[.{gitignore,eslintrc,eslintignore,prettierrc,prettierignore}]
17+
insert_final_newline = false
18+
19+
[{jest,package,tsconfig}.json]
20+
insert_final_newline = false

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Compiled source #
2+
###################
3+
*.com
4+
*.class
5+
*.dll
6+
*.exe
7+
*.o
8+
*.so
9+
10+
# Packages #
11+
############
12+
# it's better to unpack these files and commit the raw source
13+
# git has its own built in compression methods
14+
*.7z
15+
*.dmg
16+
*.gz
17+
*.iso
18+
*.jar
19+
*.rar
20+
*.tar
21+
*.zip
22+
23+
# Logs and databases #
24+
######################
25+
logs
26+
*.log
27+
npm-debug.log*
28+
.bak
29+
.sql
30+
.sqlite
31+
32+
# OS generated files #
33+
######################
34+
.DS_Store
35+
.DS_Store?
36+
._*
37+
.Spotlight-V100
38+
.Trashes
39+
ehthumbs.db
40+
Thumbs.db
41+
42+
# Text editor files #
43+
#####################
44+
.idea
45+
.classpath
46+
.project
47+
.settings
48+
.metadata
49+
.vscode
50+
.ipr
51+
52+
# Package Managers #
53+
##############
54+
node_modules
55+
bower_components
56+
jspm_packages
57+
pids
58+
.npm
59+
.node_repl_history
60+
.pid
61+
.seed
62+
63+
# Frameworks #
64+
##############
65+
.coveralls.yml
66+
.nyc_output
67+
.grunt
68+
.lock-wscript
69+
70+
# Folders #
71+
###########
72+
dist
73+
build
74+
lib-cov
75+
coverage

eslint.config.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* Copyright (c) 2017, WeirdPattern
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = {
12+
extends: ['eslint:recommended', 'prettier'],
13+
plugins: ['prettier', 'filenames'],
14+
env: {
15+
es6: true,
16+
node: true,
17+
jest: true,
18+
},
19+
rules: {
20+
semi: 'error',
21+
'no-undef': 'off',
22+
'no-unused-vars': 'off',
23+
'require-jsdoc': 'error',
24+
'no-console': [
25+
'error',
26+
{
27+
allow: ['warn', 'error'],
28+
},
29+
],
30+
'valid-jsdoc': [
31+
'error',
32+
{
33+
preferType: {
34+
any: '*',
35+
object: 'Object',
36+
},
37+
requireReturnType: true,
38+
requireParamDescription: true,
39+
requireReturnDescription: true,
40+
},
41+
],
42+
quotes: ['error', 'single', { avoidEscape: true }],
43+
'jsx-quotes': ['error', 'prefer-single'],
44+
'filenames/match-exported': ['error', 'kebab'],
45+
'prettier/prettier': [
46+
'error',
47+
{
48+
semi: true,
49+
tabWidth: 2,
50+
singleQuote: true,
51+
bracketSpacing: true,
52+
jsxBracketSameLine: true,
53+
printWidth: 80,
54+
parser: 'typescript',
55+
},
56+
],
57+
},
58+
};

index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright (c) 2017, WeirdPattern
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = require('./src/typescript');

jest.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Copyright (c) 2017, WeirdPattern
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = {
12+
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
13+
testMatch: [
14+
'<rootDir>/specs/*[.-][Ss]pec[s]?.{j,t}s{,x}',
15+
'<rootDir>/specs/**/*[.-][Ss]pec[s]?.{j,t}s{,x}',
16+
],
17+
rootDir: '.',
18+
verbose: false,
19+
resetMocks: true,
20+
resetModules: true,
21+
collectCoverage: false,
22+
collectCoverageFrom: [
23+
'**/*.{j,t}s{,x}',
24+
'!**/*.min.js',
25+
'!**/static/**',
26+
'!**/specs/**',
27+
'!**/node_modules/**',
28+
],
29+
};

0 commit comments

Comments
 (0)