Skip to content

Commit

Permalink
fix: alias 및 eslint 룰 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 committed Mar 20, 2023
1 parent 119f2c9 commit 35ca059
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 28 deletions.
5 changes: 2 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
};
14 changes: 1 addition & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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', // 진입 경로
Expand All @@ -21,18 +25,18 @@ export default {
external: ['react', 'react-dom'],
plugins: [
peerDepsExternal(),
commonjs({ include: 'node_modules/**' }),
nodeResolve({
extensions,
}),
commonjs({ include: 'node_modules/**' }),
babel({
exclude: /node_modules/,
extensions,
include: ['src/**/*'],
}),
typescript({ tsconfig: './tsconfig.json' }),
alias({
entries: [{ find: '@', replacement: './src' }],
entries: [{ find: '@', replacement: path.resolve(__dirname, './src') }],
}),
terser(),
],
Expand Down
10 changes: 5 additions & 5 deletions src/lib/ThumbnailGenerator.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/stories/components/ThumbnailGenerator.stories.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"declaration": true,
"emitDeclarationOnly": true,
},
"include": [
"src"
],
"include": ["src"],
"exclude": ["node_modules"],
"extends": "./tsconfig.paths.json"
}
1 change: 1 addition & 0 deletions tsconfig.paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@utils/*": ["src/utils/*"],
"@types/*": ["src/types/*"],
"@hooks/*": ["src/hooks/*"],
"@lib/*": ["src/lib/*"],
},
}
}

0 comments on commit 35ca059

Please sign in to comment.