This package provides Kubit's ESLint configuration as an extensible shared config.
npm install --save-dev eslint eslint-config-kubit
or
yarn add --dev eslint eslint-config-kubit
This package requires the following peer dependencies:
-
eslint
7.x | 8.x eslint-plugin-react
@typescript-eslint/parser
@typescript-eslint/eslint-plugin
eslint-plugin-no-relative-import-paths
npm install --save-dev eslint eslint-plugin-react @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-no-relative-import-paths
or
yarn add --dev eslint eslint-plugin-react @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-no-relative-import-paths
Create an .eslintrc.js
file in the root of your project and extend the configuration:
const eslintConfig = require('eslint-config-kubit');
const path = require('path');
module.exports = eslintConfig({
noIndexImportConfig: {
aliases: {
'@/components': './src/components/*',
'@/hooks': './src/hooks/*',
'@/utils': './src/utils/*',
},
},
tsConfigPath: path.resolve(__dirname, './tsconfig.json'),
});
If need override some rules, you can pass an argument to the function:
const eslintConfig = require('eslint-config-kubit');
const path = require('path');
module.exports = eslintConfig({
noIndexImportConfig: {
aliases: {
'@/types': './src/types/*',
},
},
tsConfigPath: path.resolve(__dirname, './tsconfig.json'),
overrides: [
{
files: ['**/*.{js,jsx,ts,tsx}'],
rules: {
'no-magic-numbers': 'off',
'comma-dangle': 'off',
},
},
],
});
APA License 2.0 © Kubit