<|start_filename|>.config/eslint-config.json<|end_filename|>
{
  "rules": {
    "@typescript-eslint/explicit-function-return-type": "off",
    "@typescript-eslint/no-use-before-define": "off",
    "unicorn/filename-case": [
      "error",
      {
        "case": "kebabCase"
      }
    ],
    "unicorn/no-nested-ternary": "error",
    "unicorn/prevent-abbreviations": [
      0,
      {
        "extendDefaultWhitelist": true
      }
    ]
  },
  "overrides": [
    {
      "files": "generated.ts",
      "rules": {
        "@typescript-eslint/ban-types": "off",
        "@typescript-eslint/no-unused-vars": "off",
        "@typescript-eslint/no-explicit-any": "off",
        "@typescript-eslint/no-unnecessary-condition": "off",
        "@typescript-eslint/consistent-type-definitions": "off"
      }
    }
  ]
}


<|start_filename|>.cz-config.js<|end_filename|>
const glob = require('glob');

// prettier-ignore
const types = [
  { value: "feat",     name: "feat",     description: "A new feature" },
  { value: "fix",      name: "fix",      description: "A bug fix" },
  { value: "docs",     name: "docs",     description: "Documentation only changes" },
  { value: "style",    name: "style",    description: "Changes that do not affect the meaning of the code", },
  { value: "chore",    name: "chore",    description: "Changes to the build process or auxiliary tools", },
  { value: "config",   name: "config",   description: "Changes in configuration files. Add new or remove old." },
  { value: "refactor", name: "refactor", description: "A code change that neither fixes a bug nor adds a feature", },
  { value: "perf",     name: "perf",     description: "A code change that improves performance" },
  { value: "test",     name: "test",     description: "Adding missing tests" },
  { value: "revert",   name: "revert",   description: "Revert to a commit" },
  { value: "wip",      name: "wip",      description: "Work in progress" },
]

module.exports = {
  types: types.map(beautify),
  scopes: [].concat(
    'app',
    globMap('src/*/', (path) => path.replace(/src\//, '')).filter(
      exclude(['features', 'ui', 'lib', 'app']),
    ),
    'features',
    globMap('src/features/*/', (path) => path.replace('src/', '')),
    'ui',
    globMap('src/ui/*/', (path) => path.replace(/^src\//, '')),
    'lib',
    globMap('src/lib/*/', (path) => path.replace(/^src\//, '')),
    'pages',
    globMap('src/pages/*/', (path) => path.replace(/^src\//, '')),
  ),
  allowCustomScopes: true,
  allowBreakingChanges: ['feat', 'fix', 'revert'],
  askForBreakingChangeFirst: true,
};

function beautify({ value, name, description }) {
  return {
    value,
    name: `${name.padEnd(12, ' ')} ${description}`,
  };
}

/**
 * @param {string} pattern
 * @param {(path: string) => string} fn
 */
function globMap(pattern, fn) {
  return glob
    .sync(pattern)
    .map(fn || ((path) => path))
    .map((path) => path.replace(/\/$/, ''));
}

/**
 * Check `path` to not include substring in `variants`
 * @param {string[]} variants
 * @return {(path: string) => boolean}
 */
function exclude(variants) {
  return (path) => variants.every((variant) => !path.includes(variant));
}

/**
 * Check `path` to include substring of one of `variants`
 * @param {string[]} variants
 * @return {(path: string) => boolean}
 */
function include(variants) {
  return (path) => variants.some((variant) => path.includes(variant));
}


<|start_filename|>openapi.config.js<|end_filename|>
module.exports = {
  file: 'https://cardbox.github.io/backend/api-internal/openapi.yaml',
  templateFileNameCode: 'index.gen.ts',
  outputDir: './src/shared/api/internal',
  presets: [
    [
      'effector-openapi-preset',
      {
        effectorImport: 'effector-root',
        requestName: 'requestFx',
        requestPath: '@box/shared/api/request',
      },
    ],
  ],
};


<|start_filename|>razzle.config.js<|end_filename|>
const path = require('path');
const fs = require('fs');
const dotenv = require('dotenv');

dotenv.config();

module.exports = {
  plugins: [
    {
      name: 'typescript',
      options: {
        useBabel: true,
        forkTsChecker: {
          tslint: false,
        },
      },
    },
    'svg-react-component',
  ],
  modify(config, { dev }) {
    if (dev) {
      const CRT = path.resolve(__dirname, 'tls', 'cardbox.crt');
      const KEY = path.resolve(__dirname, 'tls', 'cardbox.key');

      let devServer;

      try {
        devServer = {
          http2: true,
          https: true,
          cert: fs.readFileSync(CRT),
          key: fs.readFileSync(KEY),
        };
      } catch (error) {
        if (error.code === 'ENOENT') {
          console.error(
            `\n\n---------\n` +
              `ERROR! No local certificates found in ./tls directory.\n` +
              `Maybe you trying to start application without generating certificates first of all?\n` +
              'You can fix this via running `$ ./scripts/create-certs.sh`, but before read Development section in README.md',
          );
          process.exit(-1);
        }
        throw error;
      }

      config.devServer = {
        ...config.devServer,
        ...devServer,
      };
    }

    config.output.publicPath = config.output.publicPath.replace(
      'http://',
      '//',
    );
    config.resolve.alias['@box'] = path.resolve(__dirname, 'src');
    return config;
  },
};


<|start_filename|>tsconfig.json<|end_filename|>
{
  "compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "allowUnreachableCode": false,
    "downlevelIteration": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "jsx": "react",
    "lib": [
      "ES2015",
      "ES2016",
      "ES2017",
      "ES2018",
      "ES2019",
      "ES2020",
      "DOM",
      "DOM.Iterable"
    ],
    "module": "esnext",
    "moduleResolution": "Node",
    "noEmit": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noUnusedLocals": false,
    "baseUrl": "./src",
    "resolveJsonModule": true,
    "paths": {
      "@box/*": ["./*"]
    },
    "plugins": [
      {
        "transform": "typescript-plugin-styled-components",
        "type": "config"
      }
    ],
    "pretty": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "strictNullChecks": true,
    "suppressImplicitAnyIndexErrors": true,
    "target": "es2016",
    "types": ["react", "jest", "node", "webpack-env"]
  }
}
