Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
eslint-config-airbnb-typescript
Advanced tools
The eslint-config-airbnb-typescript package extends Airbnb's ESLint configuration, adapting it for TypeScript. It provides a set of linting rules that enforce JavaScript and TypeScript coding standards and best practices as defined by Airbnb. This package is designed to work with projects using TypeScript, helping developers to write cleaner, more consistent, and error-free code.
TypeScript Support
Integrates Airbnb's ESLint rules with TypeScript-specific adjustments. This feature allows developers to apply Airbnb's rigorous coding standards to TypeScript projects, ensuring consistency and quality in the codebase.
"extends": ["airbnb", "airbnb-typescript"]
Customizable Rules
Allows customization of linting rules. Developers can override or extend the default set provided by Airbnb to tailor the linting process to their project's specific needs, ensuring flexibility and control over code quality.
{
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }]
}
}
Provides a set of linting rules based on Google's JavaScript style guide. Similar to eslint-config-airbnb-typescript, it enforces coding standards and best practices but follows Google's guidelines instead of Airbnb's. It does not have built-in TypeScript support but can be adapted for use with TypeScript projects.
An ESLint configuration package that adheres to the 'JavaScript Standard Style' guidelines. Unlike eslint-config-airbnb-typescript, which is tailored for Airbnb's style guide and TypeScript, eslint-config-standard focuses on a different set of rules and principles for JavaScript projects. TypeScript support can be added through additional plugins.
Disables all ESLint rules that are unnecessary or might conflict with Prettier. While eslint-config-airbnb-typescript focuses on enforcing specific coding standards, eslint-config-prettier is designed to be used in conjunction with other ESLint configurations to ensure compatibility with Prettier, rather than to enforce its own style rules.
Airbnb's ESLint config with TypeScript support
Works with both JS and TS files.
Install dependencies. ESLint plugins must also be installed.
npm install eslint-config-airbnb-typescript \
eslint-plugin-import@^2.22.0 \
eslint-plugin-jsx-a11y@^6.3.1 \
eslint-plugin-react@^7.20.3 \
eslint-plugin-react-hooks@^4.0.8 \
@typescript-eslint/eslint-plugin@^4.0.1 \
--save-dev
Within your ESLint config file:
module.exports = {
extends: ['airbnb-typescript'],
parserOptions: {
project: './tsconfig.json',
},
};
Alter your eslint
command to include ts
and tsx
files:
eslint --ext .js,.jsx,.ts,.tsx ./
Install dependencies. ESLint plugins must also be installed.
npm install eslint-config-airbnb-typescript \
eslint-plugin-import@^2.22.0 \
@typescript-eslint/eslint-plugin@^4.0.1 \
--save-dev
Within your ESLint config file:
module.exports = {
extends: ['airbnb-typescript/base'],
parserOptions: {
project: './tsconfig.json',
},
};
Alter your eslint
command to include ts
and tsx
files:
eslint --ext .js,.jsx,.ts,.tsx ./
The goal of eslint-config-airbnb-typescript
is decorate eslint-config-airbnb
with TypeScript support. All rules and settings are identical. It's a drop-in replacement for eslint-config-airbnb
, including linting for JavaScript files.
It's recommended to alter your ESLint config for additional functionality. Here's an example:
{
"extends": [
"airbnb-typescript",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
}
My personal ESLint config file with support for Jest, Promises, and Prettier can be found in create-exposed-app.
Authored and maintained by Matt Turnbull (iamturns.com / @iamturns)
To all contributors (if you exist) - thank you!
Open source licensed as MIT.
FAQs
Airbnb's ESLint config with TypeScript support
The npm package eslint-config-airbnb-typescript receives a total of 0 weekly downloads. As such, eslint-config-airbnb-typescript popularity was classified as not popular.
We found that eslint-config-airbnb-typescript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.