From b9b07211f2f7b6a27edadd80ca2ea1d7ad1d676a Mon Sep 17 00:00:00 2001 From: Gleb Voitenko Date: Thu, 29 Aug 2024 13:29:11 +0300 Subject: [PATCH] feat: change tsconfig --- .eslintrc.js | 2 +- src/index.ts | 2 +- src/{ => lib}/attrs.ts | 0 {src/__tests__ => tests}/attrs.test.ts | 2 +- tsconfig.json | 6 +++--- tsconfig.tests.json | 8 ++++++++ 6 files changed, 14 insertions(+), 6 deletions(-) rename src/{ => lib}/attrs.ts (100%) rename {src/__tests__ => tests}/attrs.test.ts (99%) create mode 100644 tsconfig.tests.json diff --git a/.eslintrc.js b/.eslintrc.js index 0d62cbf..1098108 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,6 +3,6 @@ module.exports = { extends: require.resolve('@diplodoc/lint/eslint-config'), parserOptions: { tsconfigRootDir: __dirname, - project: ['./tsconfig.json'], + project: ['./tsconfig.json', './tsconfig.tests.json'], }, }; diff --git a/src/index.ts b/src/index.ts index 12934ed..c46cae0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -import {AttrsParser} from './attrs'; +import {AttrsParser} from './lib/attrs'; export {AttrsParser}; diff --git a/src/attrs.ts b/src/lib/attrs.ts similarity index 100% rename from src/attrs.ts rename to src/lib/attrs.ts diff --git a/src/__tests__/attrs.test.ts b/tests/attrs.test.ts similarity index 99% rename from src/__tests__/attrs.test.ts rename to tests/attrs.test.ts index 0eb7b16..ebb1d58 100644 --- a/src/__tests__/attrs.test.ts +++ b/tests/attrs.test.ts @@ -1,4 +1,4 @@ -import {AttrsParser} from '../attrs'; +import {AttrsParser} from '../src'; describe('attrs parser tests', () => { it('parses classes and ids', () => { diff --git a/tsconfig.json b/tsconfig.json index b3180ce..9a65af6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,14 +4,14 @@ "lib": ["ES2019", "DOM"], "target": "es6", "baseUrl": ".", - "rootDir": "src", + "rootDir": "src", "outDir": "lib/", "module": "CommonJS", "paths": { "src/*": ["src/*"], - "__tests__/*": ["__tests__/*"] + "tests/*": ["tests/*"] } }, "include": ["src"], - "exclude": ["node_modules", "src/playground.ts"] + "exclude": ["node_modules"] } diff --git a/tsconfig.tests.json b/tsconfig.tests.json new file mode 100644 index 0000000..1419957 --- /dev/null +++ b/tsconfig.tests.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "include": ["tests"], + "compilerOptions": { + "noEmit": true, + } + +} \ No newline at end of file