Skip to content

Commit c893c87

Browse files
committed
Added types and new build script
1 parent 0571b67 commit c893c87

13 files changed

Lines changed: 7691 additions & 510 deletions

.babelrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
dist/
3+
node_modules/
4+
.snapshots/
5+
*.min.js

.eslintrc

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:react/recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"prettier/@typescript-eslint",
7+
"react-app",
8+
"plugin:sonarjs/recommended"
9+
],
10+
"parserOptions": {
11+
"project": "./tsconfig.json",
12+
"createDefaultProgram": true
13+
},
14+
"plugins": ["@typescript-eslint", "prettier", "spellcheck", "sonarjs"],
15+
"env": {
16+
"browser": true,
17+
"jasmine": true,
18+
"jest": true
19+
},
20+
"rules": {
21+
"quotes": ["error", "single"],
22+
"max-len": ["error", { "code": 145, "ignoreUrls": true }],
23+
"react/display-name": "off",
24+
"react/prop-types": "off",
25+
"require-atomic-updates": "off",
26+
"sonarjs/cognitive-complexity": "off",
27+
"no-console": ["error", { "allow": ["warn", "error"] }],
28+
"comma-dangle": 0,
29+
"no-plusplus": 0,
30+
"no-continue": 0,
31+
"arrow-parens": 0,
32+
"@typescript-eslint/no-use-before-define": 0,
33+
"implicit-arrow-linebreak": 0,
34+
"object-curly-newline": 0,
35+
"operator-linebreak": 0,
36+
"function-paren-newline": 0,
37+
"no-nested-ternary": 0,
38+
"spellcheck/spell-checker": [
39+
"error",
40+
{
41+
"comments": true,
42+
"strings": false,
43+
"identifiers": true,
44+
"lang": "en_GB",
45+
"skipWords": [
46+
"webpack",
47+
"plugins",
48+
"antialias",
49+
"pixi",
50+
"coords",
51+
"bezier",
52+
"utils",
53+
"ctrl",
54+
"attn",
55+
"impactable",
56+
"rect",
57+
"sizer",
58+
"args",
59+
"color",
60+
"goto",
61+
"center",
62+
"miter",
63+
"browni",
64+
"technicolor",
65+
"params",
66+
"kodachrome",
67+
"polaroid",
68+
"truthy"
69+
],
70+
"skipIfMatch": ["http[s]?://[^s]*", "eslint.*", ".*px", ".*vh", ".*vw", "[\\s]*#.*", "ws[s]?://[^s]*"],
71+
"minLength": 4
72+
}
73+
]
74+
},
75+
"overrides": [
76+
{
77+
// enable the rule specifically for TypeScript files
78+
"files": ["*.ts", "*.tsx"],
79+
"rules": {
80+
"@typescript-eslint/explicit-function-return-type": "off",
81+
"@typescript-eslint/prefer-interface": "off",
82+
"@typescript-eslint/consistent-type-assertions": ["off"],
83+
"@typescript-eslint/no-unused-vars": ["error"]
84+
}
85+
}
86+
],
87+
"settings": {
88+
"react": {
89+
"pragma": "React",
90+
"version": "detect"
91+
}
92+
},
93+
"parser": "@typescript-eslint/parser"
94+
}

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 140,
4+
"trailingComma": "none",
5+
"arrowParens": "always",
6+
"endOfLine": "lf",
7+
"bracketSpacing": true
8+
}

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'jsdom',
4+
};

package.json

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@
22
"name": "ticker-service",
33
"version": "1.0.11",
44
"description": "A service used to create animation loops in a simple way and to keep everything in sync within an app.",
5-
"main": "src/ticker-service.js",
5+
"main": "dist/index.js",
6+
"module": "dist/index.modern.js",
7+
"source": "src/index.ts",
68
"directories": {
79
"test": "test"
810
},
911
"scripts": {
1012
"test": "jest",
11-
"build": "webpack"
13+
"build": "microbundle build"
1214
},
1315
"repository": {
1416
"type": "git",
1517
"url": "git+https://github.com/mcastiello/ticker-service.git"
1618
},
17-
"keywords": ["Ticker", "Timeout", "Timing Functions", "Animation Loop"],
19+
"keywords": [
20+
"Ticker",
21+
"Timeout",
22+
"Timing Functions",
23+
"Animation Loop"
24+
],
1825
"author": "Marco Castiello",
1926
"license": "ISC",
2027
"bugs": {
@@ -23,8 +30,27 @@
2330
"homepage": "https://github.com/mcastiello/ticker-service#readme",
2431
"devDependencies": {
2532
"@babel/plugin-transform-modules-commonjs": "^7.7.5",
26-
"jest": "^24.9.0",
27-
"webpack": "^4.41.5",
28-
"webpack-cli": "^3.3.10"
33+
"@types/jest": "^26.0.20",
34+
"eslint": "^6.8.0",
35+
"eslint-config-airbnb-typescript": "^7.0.0",
36+
"eslint-config-prettier": "^6.7.0",
37+
"eslint-config-react-app": "^5.2.1",
38+
"eslint-config-standard": "^14.1.0",
39+
"eslint-config-standard-react": "^9.2.0",
40+
"eslint-plugin-import": "^2.18.2",
41+
"eslint-plugin-jsx-a11y": "^6.2.3",
42+
"eslint-plugin-node": "^11.0.0",
43+
"eslint-plugin-prettier": "^3.1.1",
44+
"eslint-plugin-promise": "^4.2.1",
45+
"eslint-plugin-react": "^7.17.0",
46+
"eslint-plugin-react-hooks": "^3.0.0",
47+
"eslint-plugin-sonarjs": "^0.5.0",
48+
"eslint-plugin-spellcheck": "^0.0.14",
49+
"eslint-plugin-standard": "^4.0.1",
50+
"jest": "^26.6.3",
51+
"microbundle": "^0.13.0",
52+
"prettier": "^2.0.4",
53+
"ts-jest": "^26.4.4",
54+
"typescript": "^3.7.5"
2955
}
3056
}

0 commit comments

Comments
 (0)