Skip to content

Commit aedd6f9

Browse files
feat: cloned ts-project-starter as base starting point
1 parent 078cb78 commit aedd6f9

13 files changed

+5178
-0
lines changed

.editorconfig

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true

.env

Whitespace-only changes.

.eslintrc.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
plugins: ['@typescript-eslint'],
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
// Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
8+
'prettier/@typescript-eslint',
9+
// Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
10+
'plugin:prettier/recommended',
11+
],
12+
parserOptions: {
13+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
14+
sourceType: 'module', // Allows for the use of imports
15+
project: './tsconfig.json',
16+
},
17+
rules: {
18+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
19+
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
20+
'prettier/prettier': 'error',
21+
},
22+
}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.prettierrc.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
trailingComma: 'es5'
2+
tabWidth: 2
3+
semi: false
4+
singleQuote: true

.vscode/settings.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"[javascript]": {
4+
"editor.formatOnSave": false
5+
},
6+
"[javascriptreact]": {
7+
"editor.formatOnSave": false
8+
},
9+
"[typescript]": {
10+
"editor.formatOnSave": false
11+
},
12+
"[typescriptreact]": {
13+
"editor.formatOnSave": false
14+
},
15+
"eslint.autoFixOnSave": true,
16+
"eslint.validate": [
17+
{
18+
"language": "javascript",
19+
"autoFix": true
20+
},
21+
{
22+
"language": "javascriptreact",
23+
"autoFix": true
24+
},
25+
{
26+
"language": "typescript",
27+
"autoFix": true
28+
},
29+
{
30+
"language": "typescriptreact",
31+
"autoFix": true
32+
}
33+
]
34+
}

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']};

jest.config.js

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

package.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "connect-four",
3+
"version": "1.0.0",
4+
"main": "src/index.ts",
5+
"author": "Giovanni Ravalico <[email protected]>",
6+
"license": "MIT",
7+
"dependencies": {
8+
"ts-node": "^8.0.3",
9+
"typescript": "^3.3.4000"
10+
},
11+
"devDependencies": {
12+
"@commitlint/cli": "^7.5.2",
13+
"@commitlint/config-conventional": "^7.5.0",
14+
"@typescript-eslint/eslint-plugin": "^1.5.0",
15+
"@typescript-eslint/parser": "^1.5.0",
16+
"commitizen": "^3.0.7",
17+
"commitlint": "^7.5.2",
18+
"cz-conventional-changelog": "^2.1.0",
19+
"eslint": "^5.15.3",
20+
"eslint-config-prettier": "^4.1.0",
21+
"eslint-plugin-prettier": "^3.0.1",
22+
"husky": "^1.3.1",
23+
"jest": "^24.5.0",
24+
"precise-commits": "^1.0.2",
25+
"prettier": "^1.16.4"
26+
},
27+
"scripts": {
28+
"commit": "git-cz",
29+
"test": "jest"
30+
},
31+
"config": {
32+
"commitizen": {
33+
"path": "./node_modules/cz-conventional-changelog"
34+
}
35+
},
36+
"husky": {
37+
"hooks": {
38+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
39+
"pre-commit": "precise-commits"
40+
}
41+
}
42+
}

src/index.ts

Whitespace-only changes.

tsconfig.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"compilerOptions": {
3+
/* Basic Options */
4+
"target": "ESNEXT" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
5+
"module": "ESNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
6+
// "lib": [], /* Specify library files to be included in the compilation. */
7+
// "allowJs": true, /* Allow javascript files to be compiled. */
8+
"checkJs": true /* Report errors in .js files. */,
9+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
10+
// "declaration": true, /* Generates corresponding '.d.ts' file. */
11+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
12+
"sourceMap": true /* Generates corresponding '.map' file. */,
13+
// "outFile": "./", /* Concatenate and emit output to single file. */
14+
// "outDir": "./", /* Redirect output structure to the directory. */
15+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
16+
// "composite": true, /* Enable project compilation */
17+
// "removeComments": true, /* Do not emit comments to output. */
18+
// "noEmit": true, /* Do not emit outputs. */
19+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
20+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
21+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
22+
23+
/* Strict Type-Checking Options */
24+
"strict": true /* Enable all strict type-checking options. */,
25+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
26+
// "strictNullChecks": true, /* Enable strict null checks. */
27+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
28+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
29+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
30+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
31+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
32+
33+
/* Additional Checks */
34+
// "noUnusedLocals": true, /* Report errors on unused locals. */
35+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
36+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
37+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
38+
39+
/* Module Resolution Options */
40+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
41+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
42+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
43+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
44+
// "typeRoots": [], /* List of folders to include type definitions from. */
45+
// "types": [], /* Type declaration files to be included in compilation. */
46+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
47+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
48+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
49+
50+
/* Source Map Options */
51+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
52+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
53+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
54+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
55+
56+
/* Experimental Options */
57+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
58+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
59+
}
60+
}

wallaby.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = function(wallaby) {
2+
return {
3+
files: [
4+
'package.json',
5+
'tsconfig.json',
6+
'jest.config.js',
7+
'src/**/*.ts?(x)',
8+
'!src/**/*.test.ts?(x)',
9+
'!src/**/*.spec.ts?(x)',
10+
],
11+
12+
tests: ['src/**/*.spec.ts?(x)', 'src/**/*.test.ts?(x)'],
13+
14+
env: {
15+
type: 'node',
16+
runner: 'node',
17+
},
18+
19+
testFramework: 'jest',
20+
21+
22+
23+
debug: true,
24+
25+
reportConsoleErrorAsError: true,
26+
27+
lowCoverageThreshold: 80,
28+
}
29+
}

0 commit comments

Comments
 (0)