JavaScript Coding Standard
A set of ESLint rules applied to all Croct JavaScript projects.
📦 Releases
·
🐞 Report Bug
·
✨ Request Feature
The recommended way to install the package is via NPM. It pairs nicely with module bundlers such as Webpack or Browserify:
npm i -D @croct/eslint-pluginThis plugin uses ESLint's flat config format (ESLint v9+).
For JavaScript projects, create an eslint.config.mjs file:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.javascript,
);For TypeScript projects, create an eslint.config.mjs file:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.typescript,
);The TypeScript config includes the JavaScript preset, so there's no need to include both.
For React projects, create an eslint.config.mjs file:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.react,
);The React config includes the JavaScript preset, so there's no need to include both.
For Cypress projects, create an eslint.config.mjs file:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.cypress,
);The Cypress config includes the JavaScript preset, so there's no need to include both.
You can add custom rules or override existing ones:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.typescript,
{
files: ['src/**/*.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
);For the list of available presets and rules, see the reference documentation.
Run the following command to check if the project adheres to the coding standard:
eslintContributions to the package are always welcome!
- Report any bugs or issues on the issue tracker.
- For major changes, please open an issue first to discuss what you would like to change.
- Please make sure to update tests as appropriate.
Before running the test suites, the development dependencies must be installed:
npm iThen, to run all tests:
npm run testCopyright © 2015-2021 Croct Limited, All Rights Reserved.
All information contained herein is, and remains the property of Croct Limited. The intellectual, design and technical concepts contained herein are proprietary to Croct Limited s and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law. Dissemination of this information or reproduction of this material is strictly forbidden unless prior written permission is obtained from Croct Limited.