Skip to content

Commit

Permalink
Merge pull request #68 from nimblehq/bug/gh56-separate-typescript-pac…
Browse files Browse the repository at this point in the history
…kage

[#56] Separate typescript to dedicated package
  • Loading branch information
carryall authored Mar 13, 2024
2 parents fdba3f7 + c2795a1 commit 06a6b3a
Show file tree
Hide file tree
Showing 15 changed files with 427 additions and 168 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
The configurations are separated into dedicated packages:

- [eslint-config-nimble-core](/packages/eslint-config-nimble-core): ESLint core base rules
- [eslint-config-nimble-testing](/packages/eslint-config-nimble-testing): ESLint testing base rules
- [eslint-config-nimble-react](/packages/eslint-config-nimble-react): ESLint rules for React
- [eslint-config-nimble-testing](/packages/eslint-config-nimble-testing): ESLint rules for testing
- [eslint-config-nimble-typescript](/packages/eslint-config-nimble-typescript): ESLint rules for Typescript

__Usage information is in the packages' documentation.__

Expand Down
415 changes: 260 additions & 155 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions packages/eslint-config-nimble-core/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @fileoverview eslint config
* @author Nimbl3
* @author Nimble
*/
'use strict';

Expand All @@ -24,7 +24,6 @@ module.exports = {
},
extends: [
'./rules/base',
'./rules/typescript',
'./rules/import',
'./rules/prettier', // prettiter must be the last one
].map(require.resolve),
Expand Down
5 changes: 1 addition & 4 deletions packages/eslint-config-nimble-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nimblehq/eslint-config-nimble-core",
"version": "2.7.0",
"version": "2.8.0",
"description": "ESLint base configuration developed and maintained by Nimble",
"keywords": [
"eslint",
Expand All @@ -10,11 +10,8 @@
"author": "Nimble",
"main": "lib/index.js",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-prettier": "^5.0.1"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/eslint-config-nimble-react/lib/rules/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ module.exports = {
node: true,
jest: true,
},
extends: '@nimblehq/eslint-config-nimble-core',
extends: [
'@nimblehq/eslint-config-nimble-core',
'@nimblehq/eslint-config-nimble-typescript',
],
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
Expand Down
5 changes: 3 additions & 2 deletions packages/eslint-config-nimble-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nimblehq/eslint-config-nimble-react",
"version": "1.3.0",
"version": "1.4.0",
"description": "ESLint React configuration developed and maintained by Nimble",
"keywords": [
"eslint",
Expand All @@ -22,7 +22,8 @@
"lib"
],
"dependencies": {
"@nimblehq/eslint-config-nimble-core": "^2.7.0",
"@nimblehq/eslint-config-nimble-core": "2.8.0",
"@nimblehq/eslint-config-nimble-typescript": "1.0.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
Expand Down
5 changes: 4 additions & 1 deletion packages/eslint-config-nimble-testing/lib/rules/base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use strict';

module.exports = {
extends: '@nimblehq/eslint-config-nimble-core',
extends: [
'@nimblehq/eslint-config-nimble-core',
'@nimblehq/eslint-config-nimble-typescript',
],
};
5 changes: 3 additions & 2 deletions packages/eslint-config-nimble-testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nimblehq/eslint-config-nimble-testing",
"version": "1.2.0",
"version": "1.3.0",
"description": "ESLint testing plugin extension configuration developed and maintained by Nimble",
"keywords": [
"eslint",
Expand All @@ -13,7 +13,8 @@
"author": "Nimble",
"main": "lib/index.js",
"dependencies": {
"@nimblehq/eslint-config-nimble-core": "^2.7.0",
"@nimblehq/eslint-config-nimble-core": "2.8.0",
"@nimblehq/eslint-config-nimble-typescript": "1.0.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-config-nimble-typescript/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['./lib/index.js'],
};
19 changes: 19 additions & 0 deletions packages/eslint-config-nimble-typescript/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2021 and onwards Nimble.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
63 changes: 63 additions & 0 deletions packages/eslint-config-nimble-typescript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# `@nimblehq/eslint-config-nimble-typescript`

This package provides ESLint Typescript rules inheriting from @nimblehq/eslint-config-nimble-core.

## Installation

```bash
npm install --save-dev @nimblehq/eslint-config-nimble-typescript
```

## Usage

### Standalone

Add `@nimblehq/eslint-config-nimble-typescript` to the extends section of your `.eslintrc` configuration file.

```js
{
"extends": [
"@nimblehq/eslint-config-nimble-typescript"
],
"rules": {
// Additional, per-project rules...
}
}
```

### With a framework

Similar to the process above, but usually it requires adding the extra rules for the JS framework:

```js
{
"extends": [
"@nimblehq/eslint-config-nimble-typescript",
"plugin:react/recommended",
"plugin:vue/recommended"
],
"rules": {
// Additional, per-project rules...
}
}
```

This would require defining the required dependencies in the project itself.

## License

This project is Copyright (c) 2021 and onwards Nimble. It is free software and may be redistributed under the terms specified in the [LICENSE] file.

[LICENSE]: /LICENSE

## About

![Nimble](https://assets.nimblehq.co/logo/dark/logo-dark-text-160.png)

This project is maintained and funded by [Nimble](https://nimblehq.co).

We love open source and do our part in sharing our work with the community!
See [our other projects][community] or [hire our team][hire] to help build your product.

[community]: https://github.com/nimblehq
[hire]: https://nimblehq.co/
10 changes: 10 additions & 0 deletions packages/eslint-config-nimble-typescript/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @fileoverview eslint typescript config
* @author Nimble
*/
'use strict';

module.exports = {
extends: ['./rules/base', './rules/typescript'].map(require.resolve),
rules: {},
};
5 changes: 5 additions & 0 deletions packages/eslint-config-nimble-typescript/lib/rules/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: '@nimblehq/eslint-config-nimble-core',
};
49 changes: 49 additions & 0 deletions packages/eslint-config-nimble-typescript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "@nimblehq/eslint-config-nimble-typescript",
"version": "1.0.0",
"description": "ESLint config for TypeScript projects by Nimble",
"keywords": [
"eslint",
"eslintconfig",
"eslint-config",
"typescript",
"nimble",
"nimblehq"
],
"author": "Nimble",
"main": "lib/index.js",
"dependencies": {
"@nimblehq/eslint-config-nimble-core": "2.8.0",
"eslint-import-resolver-typescript": "^3.6.1"
},
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"license": "MIT",
"directories": {
"lib": "lib"
},
"engines": {
"node": "^14.18.2 || >=18"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nimblehq/eslint-config-nimble.git"
},
"bugs": {
"url": "https://github.com/nimblehq/eslint-config-nimble/issues"
},
"homepage": "https://github.com/nimblehq/eslint-config-nimble",
"files": [
"lib"
],
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"eslint": "^8.56.0"
}
}

0 comments on commit 06a6b3a

Please sign in to comment.