eslint-plugin-nka

1.3.0 • Public • Published

eslint-plugin-nka

NPM version

Installation

Install it with yarn:

yarn add eslint-plugin-nka

Or with npm:

npm install eslint-plugin-nka

Configuration 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

Dependencies (10)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i eslint-plugin-nka

    Weekly Downloads

    19

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    13.3 kB

    Total Files

    13

    Last publish

    Collaborators

    • neruchev