1.3.0 • Published 1 year ago
eslint-plugin-nka v1.3.0
eslint-plugin-nka
Installation
Install it with yarn:
yarn add eslint-plugin-nkaOr with npm:
npm install eslint-plugin-nkaConfiguration example
Use .eslintrc.js file to configure rules. See also about eslint configuring here.
Add plugin:nka/recommended to the extends section of your .eslintrc configuration file. Note that we can omit the eslint-plugin- prefix:
module.exports = {
parserOptions: { project: './tsconfig.json' },
+ extends: ['plugin:nka/recommended'],
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
settings: {
react: { version: '18.3.0' },
},
};Configurable rules
module.exports = {
parserOptions: { project: './tsconfig.json' },
+ extends: ['plugin:nka/recommended'],
+ rules: {
+ 'nka/no-full-import-of-libraries': ['error', ['antd', 'antd/lib']],
+ 'nka/no-selective-import-of-libraries': ['error', ['shared', 'src/components/icons']],
+ },
};Check dictionaries
module.exports = {
parserOptions: { project: './tsconfig.json' },
+ extends: ['plugin:nka/recommended'],
+ overrides: [
+ {
+ files: ['src/i18n/dictionaries/**/*.ts'],
+ rules: {
+ 'nka/no-incorrect-paths-in-dictionary-keys': ['error', ['error.', 'success.']],
+ 'nka/no-unused-dictionary-keys': 'error',
+ },
+ },
+ ],
};License
MIT