Skip to content

Commit

Permalink
don't init during assignment to module.exports as TS compiler doesn…
Browse files Browse the repository at this point in the history
…'t associate the JSDoc type declaration properly
  • Loading branch information
fire332 committed Mar 31, 2024
1 parent 7df6ee6 commit 50ec2f7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
const config = {
root: true,

env: {
Expand Down Expand Up @@ -35,3 +35,5 @@ module.exports = {
'no-unmodified-loop-condition': 'error'
}
};

module.exports = config;
4 changes: 3 additions & 1 deletion .prettierrc.js → .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('prettier').Config} */
module.exports = {
const config = {
trailingComma: 'none',
singleQuote: true,
overrides: [
Expand All @@ -11,3 +11,5 @@ module.exports = {
}
]
};

export default config;
4 changes: 3 additions & 1 deletion src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* eslint-env node */

/** @type {import('eslint').Linter.Config} */
module.exports = {
const config = {
env: {
browser: true,
node: false
}
};

module.exports = config;
6 changes: 4 additions & 2 deletions webpack.config.js → webpack.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const CopyPlugin = require('copy-webpack-plugin');
import CopyPlugin from 'copy-webpack-plugin';

/** @type {(env: Record<string, string>) => (import('webpack').Configuration)[]} */
module.exports = () => [
const makeConfig = () => [
{
/**
* NOTE: Builds with devtool = 'eval' contain very big eval chunks which seem
Expand Down Expand Up @@ -57,3 +57,5 @@ module.exports = () => [
]
}
];

export default makeConfig;

0 comments on commit 50ec2f7

Please sign in to comment.