diff --git a/.eslintrc.js b/.eslintrc.js index 3aa6b8b..a6ee727 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,11 +15,10 @@ module.exports = { ], rules: { '@typescript-eslint/no-var-requires': 'off', - // require 쓰는 것을 방지하는 옵션인데 끔 '@typescript-eslint/explicit-function-return-type': 'off', - // 함수 반환 타입 지정 끔 '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-explicit-any': 'off', // any 타입사용을 방지하는 옵션 끔 + '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unnecessary-type-constraint': 'off', + 'import/no-anonymous-default-export': 'off', }, }; diff --git a/package.json b/package.json index 390a6ec..07957a3 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "url": "git+https://github.com/ssi02014/react-thumbnail-generator.git" }, "author": "Gromit", - "license": "ISC", + "license": "MIT", "bugs": { "url": "https://github.com/ssi02014/react-thumbnail-generator.git/issues" }, @@ -70,18 +70,6 @@ "tsconfig-paths-webpack-plugin": "^4.0.0", "typescript": "^4.9.5" }, - "eslintConfig": { - "overrides": [ - { - "files": [ - "**/*.stories.*" - ], - "rules": { - "import/no-anonymous-default-export": "off" - } - } - ] - }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" diff --git a/rollup.config.mjs b/rollup.config.mjs index 15c7432..23cf6e9 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -6,8 +6,12 @@ import commonjs from '@rollup/plugin-commonjs'; import peerDepsExternal from 'rollup-plugin-peer-deps-external'; import alias from '@rollup/plugin-alias'; import pkg from './package.json' assert { type: 'json' }; +import path from 'path'; const extensions = ['.js', '.jsx', '.ts', '.tsx']; +const __dirname = path.resolve(); + +process.env.BABEL_ENV = 'production'; export default { input: './src/index.tsx', // 진입 경로 @@ -21,10 +25,10 @@ export default { external: ['react', 'react-dom'], plugins: [ peerDepsExternal(), - commonjs({ include: 'node_modules/**' }), nodeResolve({ extensions, }), + commonjs({ include: 'node_modules/**' }), babel({ exclude: /node_modules/, extensions, @@ -32,7 +36,7 @@ export default { }), typescript({ tsconfig: './tsconfig.json' }), alias({ - entries: [{ find: '@', replacement: './src' }], + entries: [{ find: '@', replacement: path.resolve(__dirname, './src') }], }), terser(), ], diff --git a/src/lib/ThumbnailGenerator.tsx b/src/lib/ThumbnailGenerator.tsx index a67342a..4dc5ab1 100644 --- a/src/lib/ThumbnailGenerator.tsx +++ b/src/lib/ThumbnailGenerator.tsx @@ -1,10 +1,10 @@ -import TG from '../components/TG'; -import { TGOpenButton } from '../components/TG.styled'; import React, { useState } from 'react'; +import TG from '@components/TG'; +import { TGOpenButton } from '@components/TG.styled'; import { toggleButton } from '@assets/icons'; -import { Position, getIconSize } from '../utils/style'; -import TGPortal from '../components/TGPortal'; -import Icon from '../components/Icon'; +import { Position, getIconSize } from '@utils/style'; +import TGPortal from '@components/TGPortal'; +import Icon from '@components/Icon'; interface ThumbnailGeneratorProps { id?: string; diff --git a/src/stories/components/ThumbnailGenerator.stories.tsx b/src/stories/components/ThumbnailGenerator.stories.tsx index 661bc27..d00c180 100644 --- a/src/stories/components/ThumbnailGenerator.stories.tsx +++ b/src/stories/components/ThumbnailGenerator.stories.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Story } from '@storybook/react/types-6-0'; -import ThumbnailGenerator from '../../lib/ThumbnailGenerator'; -import { Size } from '../../utils/style'; +import ThumbnailGenerator from '@lib/ThumbnailGenerator'; +import { Size } from '@utils/style'; import { toggleButton } from '@assets/icons'; export default { diff --git a/tsconfig.json b/tsconfig.json index 8d6a988..ace2d65 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,8 +23,7 @@ "declaration": true, "emitDeclarationOnly": true, }, - "include": [ - "src" - ], + "include": ["src"], + "exclude": ["node_modules"], "extends": "./tsconfig.paths.json" } diff --git a/tsconfig.paths.json b/tsconfig.paths.json index b4efb49..642f291 100644 --- a/tsconfig.paths.json +++ b/tsconfig.paths.json @@ -7,6 +7,7 @@ "@utils/*": ["src/utils/*"], "@types/*": ["src/types/*"], "@hooks/*": ["src/hooks/*"], + "@lib/*": ["src/lib/*"], }, } } \ No newline at end of file