title: Const declarations require an initialization value
body: <p>I want to add TypeScript to my project and I got this error while adding a type to the array:</p>
  <pre class="lang-none prettyprint-override"><code>SyntaxError:
  my/path/of/file:
  Const declarations require an initialization value (2:28)
  
    1 | //keycodes of restricted characters for all our amount inputs    
    2 | export const restrictedChars: number[] = [ 43, 45, 69, 107, 109, 187, 188, 189, 190 ];         
  </code></pre>
  <p>Here's the code:</p>
  <pre><code>//keycodes of restricted characters for all our amount inputs
  export const restrictedChars: number[] = [ 43, 45, 69, 107, 109, 187, 188, 189, 190 ];
  </code></pre>
  <p>I tried to declare the array and after that export but it didn't worked. Also I tried to create an interface for that array as mentioned in some solutions for problems like this but it didn't helped too.</p>
  <p><strong>webpack.config.js</strong></p>
  <pre><code>const path = require(&quot;path&quot;);
  const webpack = require(&quot;webpack&quot;);
  
  module.exports = {
    entry: &quot;./src/index.tsx&quot;,
    mode: &quot;development&quot;,
    module: {
      rules: [
        {
          test: /\.(js|jsx|ts|tsx)$/,
          exclude: /(node_modules|bower_components)/,
          loader: &quot;babel-loader&quot;,
          options: { presets: [&quot;@babel/env&quot;] }
        },
        {
          test: /\.css$/,
          use: [&quot;style-loader&quot;, &quot;css-loader&quot;]
        }
      ]
    },
    resolve: { extensions: [&quot;*&quot;, &quot;.js&quot;, &quot;.jsx&quot;, &quot;.ts&quot;, &quot;.tsx&quot;] },
    output: {
      path: path.resolve(__dirname, &quot;dist/&quot;),
      publicPath: &quot;/dist/&quot;,
      filename: &quot;bundle.js&quot;
    },
    devServer: {
      contentBase: path.join(__dirname, &quot;public/&quot;),
      port: 3000,
      publicPath: &quot;http://localhost:3000/dist/&quot;,
      historyApiFallback: true,
      hot: true
    },
    plugins: [new webpack.HotModuleReplacementPlugin()]
  };
  </code></pre>
  <p><strong>package.json</strong></p>
  <pre><code>{
    &quot;name&quot;: &quot;WhatToCook&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;./src/index.tsx&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,
      &quot;start&quot;: &quot;webpack-dev-server --mode development --open --hot&quot;
    },
    &quot;keywords&quot;: [],
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;devDependencies&quot;: {
      &quot;@babel/cli&quot;: &quot;^7.12.13&quot;,
      &quot;@babel/core&quot;: &quot;^7.12.13&quot;,
      &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.12.13&quot;,
      &quot;@babel/preset-env&quot;: &quot;^7.12.13&quot;,
      &quot;@babel/preset-react&quot;: &quot;^7.12.13&quot;,
      &quot;@types/react-dom&quot;: &quot;^17.0.3&quot;,
      &quot;@types/react-redux&quot;: &quot;^7.1.16&quot;,
      &quot;@types/react-router-dom&quot;: &quot;^5.1.7&quot;,
      &quot;babel-loader&quot;: &quot;^8.2.2&quot;,
      &quot;css-loader&quot;: &quot;^1.0.1&quot;,
      &quot;style-loader&quot;: &quot;^0.23.1&quot;,
      &quot;webpack&quot;: &quot;^4.46.0&quot;,
      &quot;webpack-cli&quot;: &quot;^3.3.12&quot;,
      &quot;webpack-dev-server&quot;: &quot;^3.11.2&quot;
    },
    &quot;dependencies&quot;: {
      &quot;lodash&quot;: &quot;^4.17.20&quot;,
      &quot;react&quot;: &quot;^17.0.1&quot;,
      &quot;react-addons-update&quot;: &quot;^15.6.3&quot;,
      &quot;react-dom&quot;: &quot;^17.0.1&quot;,
      &quot;react-hot-loader&quot;: &quot;^4.13.0&quot;,
      &quot;react-jss&quot;: &quot;^10.5.1&quot;,
      &quot;react-redux&quot;: &quot;^7.2.2&quot;,
      &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
      &quot;redux&quot;: &quot;^4.0.5&quot;,
      &quot;redux-devtools-extension&quot;: &quot;^2.13.8&quot;,
      &quot;redux-thunk&quot;: &quot;^2.3.0&quot;
    }
  }
  </code></pre>