@crometrics/eslint-config-crometrics-typescript
v3.2.1
Published
<h1 align="center">eslint-config-crometrics-typescript</h1>
Downloads
394
Readme
Contains the Cro Metrics' TypeScript linting rules for ESLint.
The intent of our ESLint configs is to provide a common set of rules for coding within the Cro Metrics' codebase. Having installable ESLint configs will streamline and simplify using our style guide across various projects/repos easier.
Installation and Usage Instructions
- Run
npx install-peerdeps @crometrics/eslint-config-crometrics-typescript@latest
- Add the package to the
extends
array/string in your.eslintrc.*
.
Example
An example bare bones .eslintrc.*
config with no other rules, plugins, extended configs, etc. would look like:
// .eslintrc.cjs
module.exports = {
extends: ['@crometrics/eslint-config-crometrics-typescript'],
overrides: [],
};
Override specific settings by specifying them in the rules
object as normal. See http://eslint.org/docs/developer-guide/shareable-configs for more details.
You can add additional extended configs, plugins, rules, globals, parser options, env options, etc. the same as you normally would.
Example
// eslintrc.cjs
module.exports = {
extends: [
'@crometrics/eslint-config-crometrics-typescript',
'plugin:react/recommended',
],
plugins: ['react'],
rules: {
// Any project specific rules or rules for plugins/additional configs here
'react/no-unescaped-entities': ['off'],
},
globals: {
// Add any project globals here
PJS: true,
},
};
Available Configs
See eslint-config-crometrics/packages/ to view all available configs.
Of note, there is a base configuration for projects that only use JavaScript.
- If your project contains any TypeScript:
- Install only this module
- If your project is only JavaScript:
- Install only
eslint-config-crometrics-base
(Link)
- Install only
IMPORTANT NOTE:
There is no reason to install both eslint-config-crometrics-base
and eslint-config-crometrics-typescript
in the same project and doing so will give you problems.
Making Changes and Publishing Updates
- Make the changes you want to make in
/packages/eslint-config-crometrics-typescript/index.js
or/packages/eslint-config-crometrics-typescript/rules/[filename].js
. - Increment
version
inpackage.json
. - Commit and push changes to the repo
- From the root directory of this repo, run
npm publish
to publish from the repo to npm - Run
npm update @crometrics/eslint-config-crometrics-typescript
(or simplynpm update
to update all npm packages) in the projects where the config is installed - Make a post in the
#-engineering
Slack channel informing others to runnpm update @crometrics/eslint-config-crometrics-typescript
ornpm update
as well