Skip to content

Commit 371adea

Browse files
feat: initial commit
0 parents  commit 371adea

31 files changed

+6578
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Node
2+
/node_modules
3+
4+
# Logs
5+
*.log
6+
7+
# Generated Files
8+
/.rpt2_cache
9+
/coverage
10+
/dist
11+
/.eslintrc

.gitlab-ci.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
stages:
2+
- test
3+
4+
test:
5+
stage: test
6+
image: node:8.9.3
7+
script:
8+
- npm install
9+
- npm run test
10+
only:
11+
- branches
12+
tags:
13+
- docker

.travis.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: node_js
2+
cache:
3+
yarn: true
4+
directories:
5+
- node_modules
6+
notifications:
7+
email: false
8+
node_js:
9+
- "12"
10+
before_script:
11+
script:
12+
- yarn lint
13+
- yarn test
14+
after_success:
15+
- yarn report-coverage

LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019, Rebecca Stevens
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<h1 align="center">My ESLint Config</h1>
2+
3+
<p align="center">An ESLint <a href="https://eslint.org/docs/developer-guide/shareable-configs.html">Shareable Config.</a></p>
4+
5+
<p align="center">
6+
<a href="https://www.npmjs.com/package/@rebeccastevens/eslint-config"><img alt="npm version" src="https://img.shields.io/npm/v/@rebeccastevens/eslint-config.svg?logo=npm&style=flat-square" /></a>
7+
<a href="https://travis-ci.com/RebeccaStevens/eslint-config-rebeccastevens"><img alt="travis build" src="https://img.shields.io/travis/com/RebeccaStevens/eslint-config-rebeccastevens/master.svg?logo=travis&style=flat-square" /></a>
8+
<a href="https://commitizen.github.io/cz-cli/"><img alt="Commitizen friendly" src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square" /></a>
9+
<a href="https://opensource.org/licenses/BSD-3-Clause"><img alt="BSD 3 Clause license" src="https://img.shields.io/github/license/RebeccaStevens/eslint-config-rebeccastevens.svg?style=flat-square" /></a>
10+
<br>
11+
<a href="https://codecov.io/gh/RebeccaStevens/eslint-config-rebeccastevens"><img alt="codecov" src="https://codecov.io/gh/RebeccaStevens/eslint-config-rebeccastevens/branch/master/graph/badge.svg?style=flat-square" /></a>
12+
<a href="https://greenkeeper.io/"><img alt="greenkeeper" src="https://badges.greenkeeper.io/RebeccaStevens/eslint-config-rebeccastevens.svg?style=flat-square" /></a>
13+
<a href="https://david-dm.org/RebeccaStevens/eslint-config-rebeccastevens"><img alt="dependencies status" src="https://img.shields.io/david/RebeccaStevens/eslint-config-rebeccastevens.svg?logo=david&style=flat-square" /></a>
14+
<a href="https://david-dm.org/RebeccaStevens/eslint-config-rebeccastevens?type=dev"><img alt="dev dependencies status" src="https://img.shields.io/david/dev/RebeccaStevens/eslint-config-rebeccastevens.svg?logo=david&style=flat-square" /></a>
15+
</p>
16+
17+
<br>
18+
19+
## Installation
20+
21+
```sh
22+
yarn add -D \
23+
eslint \
24+
@rebeccastevens/eslint-config \
25+
@typescript-eslint/parser \
26+
@typescript-eslint/eslint-plugin \
27+
eslint-plugin-eslint-comments \
28+
eslint-plugin-functional \
29+
eslint-plugin-import \
30+
eslint-plugin-jsdoc \
31+
eslint-plugin-markdown \
32+
eslint-plugin-optimize-regex \
33+
eslint-plugin-promise \
34+
eslint-plugin-simple-import-sort \
35+
eslint-plugin-sonarjs \
36+
eslint-plugin-unicorn
37+
```
38+
39+
## Usage
40+
41+
`.eslintrc`
42+
43+
```jsonc
44+
{
45+
"root": true,
46+
"parserOptions": {
47+
"project": "./tsconfig.json"
48+
},
49+
"extends": ["@rebeccastevens/eslint-config"],
50+
"rules": {
51+
// Additional, per-project rules...
52+
},
53+
"overrides": [
54+
// Additional, per-project overrides...
55+
{
56+
"files": ["**/*.test.ts"],
57+
"rules": {
58+
// ...
59+
}
60+
}
61+
]
62+
}
63+
```
64+
65+
See [ESLint configuration](http://eslint.org/docs/user-guide/configuring) for
66+
mor information.

jest.config.js

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
// For a detailed explanation regarding each configuration property, visit:
2+
// https://jestjs.io/docs/en/configuration.html
3+
4+
// @ts-check
5+
6+
module.exports = {
7+
// All imported modules in your tests should be mocked automatically
8+
// automock: false,
9+
10+
// Stop running tests after `n` failures
11+
// bail: 0,
12+
13+
// Respect 'browser' field in package.json when resolving modules
14+
// browser: false,
15+
16+
// The directory where Jest should store its cached dependency information
17+
// cacheDirectory: '/tmp/jest_rs',
18+
19+
// Automatically clear mock calls and instances between every test
20+
// clearMocks: false,
21+
22+
// Indicates whether the coverage information should be collected while
23+
// executing the test
24+
collectCoverage: true,
25+
26+
// An array of glob patterns indicating a set of files for which coverage
27+
// information should be collected
28+
collectCoverageFrom: ['src/**/*.ts'],
29+
30+
// The directory where Jest should output its coverage files
31+
coverageDirectory: 'coverage',
32+
33+
// An array of regexp pattern strings used to skip coverage collection
34+
// coveragePathIgnorePatterns: [
35+
// '/node_modules/'
36+
// ],
37+
38+
// A list of reporter names that Jest uses when writing coverage reports
39+
coverageReporters: [
40+
'text',
41+
'lcov'
42+
],
43+
44+
// An object that configures minimum threshold enforcement for coverage
45+
// results
46+
// coverageThreshold: null,
47+
48+
// A path to a custom dependency extractor
49+
// dependencyExtractor: null,
50+
51+
// Make calling deprecated APIs throw helpful error messages
52+
// errorOnDeprecated: false,
53+
54+
// Force coverage collection from ignored files using an array of glob
55+
// patterns
56+
// forceCoverageMatch: [],
57+
58+
// A path to a module which exports an async function that is triggered once
59+
// before all test suites
60+
// globalSetup: null,
61+
62+
// A path to a module which exports an async function that is triggered once
63+
// after all test suites
64+
// globalTeardown: null,
65+
66+
// A set of global variables that need to be available in all test
67+
// environments
68+
globals: {
69+
'ts-jest': {
70+
tsConfig: 'tsconfig.tests.json'
71+
}
72+
},
73+
74+
// An array of directory names to be searched recursively up from the
75+
// requiring module's location
76+
// moduleDirectories: [
77+
// 'node_modules'
78+
// ],
79+
80+
// An array of file extensions your modules use
81+
moduleFileExtensions: [
82+
'js',
83+
'json',
84+
'jsx',
85+
'ts',
86+
'tsx',
87+
'node'
88+
],
89+
90+
// A map from regular expressions to module names that allow to stub out
91+
// resources with a single module
92+
// moduleNameMapper: {},
93+
94+
// An array of regexp pattern strings, matched against all module paths before
95+
// considered 'visible' to the module loader
96+
// modulePathIgnorePatterns: [],
97+
98+
// Activates notifications for test results
99+
// notify: false,
100+
101+
// An enum that specifies notification mode. Requires { notify: true }
102+
// notifyMode: 'failure-change',
103+
104+
// A preset that is used as a base for Jest's configuration
105+
// preset: null,
106+
107+
// Run tests from one or more projects
108+
// projects: null,
109+
110+
// Use this configuration option to add custom reporters to Jest
111+
// reporters: undefined,
112+
113+
// Automatically reset mock state between every test
114+
// resetMocks: false,
115+
116+
// Reset the module registry before running each individual test
117+
// resetModules: false,
118+
119+
// A path to a custom resolver
120+
// resolver: null,
121+
122+
// Automatically restore mock state between every test
123+
// restoreMocks: false,
124+
125+
// The root directory that Jest should scan for tests and modules within
126+
// rootDir: null,
127+
128+
// A list of paths to directories that Jest should use to search for files in
129+
// roots: [
130+
// '<rootDir>'
131+
// ],
132+
133+
// Allows you to use a custom runner instead of Jest's default test runner
134+
// runner: 'jest-runner',
135+
136+
// The paths to modules that run some code to configure or set up the testing
137+
// environment before each test
138+
// setupFiles: [],
139+
140+
// A list of paths to modules that run some code to configure or set up the
141+
// testing framework before each test
142+
// setupFilesAfterEnv: [],
143+
144+
// A list of paths to snapshot serializer modules Jest should use for snapshot
145+
// testing
146+
// snapshotSerializers: [],
147+
148+
// The test environment that will be used for testing
149+
testEnvironment: 'node',
150+
151+
// Options that will be passed to the testEnvironment
152+
// testEnvironmentOptions: {},
153+
154+
// Adds a location field to test results
155+
// testLocationInResults: false,
156+
157+
// The glob patterns Jest uses to detect test files
158+
// testMatch: [
159+
// '**/__tests__/**/*.[jt]s?(x)',
160+
// '**/?(*.)+(spec|test).[tj]s?(x)'
161+
// ],
162+
163+
// An array of regexp pattern strings that are matched against all test paths,
164+
// matched tests are skipped
165+
// testPathIgnorePatterns: [
166+
// '/node_modules/'
167+
// ],
168+
169+
// The regexp pattern or array of patterns that Jest uses to detect test files
170+
// testRegex: [],
171+
172+
// This option allows the use of a custom results processor
173+
// testResultsProcessor: null,
174+
175+
// This option allows use of a custom test runner
176+
// testRunner: 'jasmine2',
177+
178+
// This option sets the URL for the jsdom environment. It is reflected in
179+
// properties such as location.href
180+
// testURL: 'http://localhost',
181+
182+
// Setting this value to 'fake' allows the use of fake timers for functions
183+
// such as 'setTimeout'
184+
// timers: 'real',
185+
186+
// A map from regular expressions to paths to transformers
187+
transform: {
188+
'^.+\\.ts$': 'ts-jest'
189+
},
190+
191+
// An array of regexp pattern strings that are matched against all source file
192+
// paths, matched files will skip transformation
193+
// transformIgnorePatterns: [
194+
// '/node_modules/'
195+
// ],
196+
197+
// An array of regexp pattern strings that are matched against all modules
198+
// before the module loader will automatically return a mock for them
199+
// unmockedModulePathPatterns: undefined,
200+
201+
// Indicates whether each individual test should be reported during the run
202+
// verbose: null,
203+
204+
// An array of regexp patterns that are matched against all source file paths
205+
// before re-running tests in watch mode
206+
// watchPathIgnorePatterns: [],
207+
208+
// Whether to use watchman for file crawling
209+
// watchman: true,
210+
};

0 commit comments

Comments
 (0)