Skip to content

Commit 691fe4e

Browse files
committed
Refactor getDtsSnapshot and dotenv helpers
Resolves #37 Resolves #45 Resolves #46 Resolves #53
1 parent 14e7063 commit 691fe4e

27 files changed

+1440
-626
lines changed

.eslintrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": [
3+
"plugin:@typescript-eslint/recommended",
4+
"prettier",
5+
"prettier/@typescript-eslint"
6+
],
7+
"root": true,
8+
"rules": {
9+
"@typescript-eslint/explicit-function-return-type": 0
10+
}
11+
}

.github/workflows/ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ jobs:
1010
- uses: actions/setup-node@v1
1111
with:
1212
node-version: 10.x
13-
- name: Yarn install, build, and test
14-
run: |
15-
yarn install
16-
yarn build
17-
yarn test
13+
- name: Install
14+
run: yarn install --frozen-lockfile
15+
- name: Lint
16+
run: yarn lint
17+
- name: Test
18+
run: yarn test
19+
- name: Build
20+
run: yarn build

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
src/helpers/__tests__/fixtures/test.module.less
1+
src/helpers/__tests__/fixtures/*.less
2+
src/helpers/__tests__/fixtures/*.css
3+
src/helpers/__tests__/fixtures/*.scss
4+
/lib/

package.json

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-plugin-css-modules",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"main": "lib/index.js",
55
"author": "Brody McKee <mrmckeb@hotmail.com>",
66
"license": "MIT",
@@ -25,12 +25,13 @@
2525
],
2626
"scripts": {
2727
"build": "rm -rf ./lib && tsc",
28+
"lint": "eslint './src/**/*.ts' --max-warnings 0 && yarn prettier './**/*.{json,md,ts,yml}' -c",
2829
"prepublishOnly": "yarn build",
2930
"test": "jest ./src"
3031
},
3132
"husky": {
3233
"hooks": {
33-
"pre-commit": "pretty-quick --staged",
34+
"pre-commit": "lint-staged",
3435
"pre-push": "yarn test"
3536
}
3637
},
@@ -39,37 +40,61 @@
3940
"src/**/*.{ts}"
4041
],
4142
"preset": "ts-jest",
42-
"testEnvironment": "node"
43+
"testEnvironment": "node",
44+
"testPathIgnorePatterns": [
45+
"/node_modules/",
46+
"/fixtures/"
47+
]
48+
},
49+
"lint-staged": {
50+
"./src/**/*.ts": [
51+
"eslint --fix",
52+
"prettier --write",
53+
"git add"
54+
],
55+
"./**/*.{json,md,yml}": [
56+
"prettier --write",
57+
"git add"
58+
]
4359
},
4460
"prettier": {
4561
"arrowParens": "always",
4662
"singleQuote": true,
4763
"trailingComma": "all"
4864
},
4965
"dependencies": {
66+
"dotenv": "^8.2.0",
5067
"icss-utils": "^4.1.1",
5168
"less": "^3.9.0",
5269
"lodash": "^4.17.14",
5370
"postcss": "^7.0.17",
71+
"postcss-filter-plugins": "^3.0.1",
5472
"postcss-icss-selectors": "^2.0.3",
5573
"postcss-load-config": "^2.1.0",
5674
"reserved-words": "^0.1.2",
5775
"sass": "^1.22.4"
5876
},
5977
"devDependencies": {
78+
"@types/icss-utils": "^4.1.0",
6079
"@types/jest": "^24.0.15",
6180
"@types/less": "^3.0.0",
6281
"@types/lodash": "^4.14.136",
63-
"@types/node": "^10.0.0",
82+
"@types/node": "^12.11.1",
83+
"@types/postcss-load-config": "^2.0.0",
84+
"@types/postcss-nested": "^4.1.0",
85+
"@types/reserved-words": "^0.1.0",
6486
"@types/sass": "^1.16.0",
65-
"husky": "^2.7.0",
87+
"@typescript-eslint/eslint-plugin": "^2.4.0",
88+
"@typescript-eslint/parser": "^2.4.0",
89+
"eslint": "^6.5.1",
90+
"eslint-config-prettier": "^6.4.0",
91+
"husky": "^3.0.9",
6692
"jest": "^24.8.0",
93+
"lint-staged": "^9.4.2",
6794
"postcss-import-sync2": "^1.1.0",
6895
"prettier": "^1.18.2",
69-
"pretty-quick": "^1.11.1",
7096
"ts-jest": "^24.0.2",
71-
"tslint": "^5.18.0",
72-
"typescript": "^3.5.3"
97+
"typescript": "^3.6.4"
7398
},
7499
"peerDependencies": {
75100
"typescript": "^3.0.0"

src/@types/icss-utils.d.ts

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

src/@types/postcss-filter-plugins.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare module 'postcss-filter-plugins' {
2+
import { Plugin } from 'postcss';
3+
interface Options {
4+
direction?: 'backward' | 'both' | 'forward';
5+
exclude?: string[];
6+
silent?: boolean;
7+
}
8+
const filter: (options?: Options) => Plugin<unknown>;
9+
export = filter;
10+
}

src/@types/postcss-load.config.d.ts

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

src/@types/postcss-nested.d.ts

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

src/@types/reserved-words.d.ts

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

src/@types/strip-css-singleline-comments.d.ts

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

src/config.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/helpers/DtsSnapshotCreator.ts

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

src/helpers/__tests__/DtsSnapshotCreator.test.ts

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

0 commit comments

Comments
 (0)