@atlascommunity/tsconfig-base
v1.1.2
Published
Base tsconfig
Downloads
399
Readme
Atlas Community Base tsconfig
Installation
yarn add --dev @atlascommunity/tsconfig-base
In tsconfig.json add row:
"extends": "@atlascommunity/tsconfig-base"
Migration from v1.0.9 to v1.1.0
tsconfig.json
- Remove
module
andnoEmit
fields in your tsconfig
webpack.config.js
- Change the ts-loader to:
{
test: /\.(ts|tsx)$/,
use: [{
loader: 'ts-loader',
options: { compilerOptions: { noEmit: false } },
}],
exclude: /node_modules/,
},
- Change the css-loader to:
// This will allow you to use regular css import in conjunction with modules
{
loader: 'css-loader',
options: {
esModule: true,
modules: {
namedExport: true,
auto: /\.module\.\w+$/i,
},
},
},
- Add a field after
module
// This will prevent unnamed dependency imports
module: {
strictExportPresence: true,
// rules { ...
}
- If you are using modules in your project, add this to your
.d.ts
file
declare module "*.module.css" {
const content: Record<string, string>;
export = content;
}
declare module "*.module.pcss" {
const content: Record<string, string>;
export = content;
}
package.json
- If your
package.json
uses thesideEffects
field, remove it - Update your
typescript
to the latest version(^5.6.*)
New rules for using named module imports
Old import:
import styles from './file.module.css'
New import:
import * as styles from './file.module.css'