Skip to content

Commit

Permalink
v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
aMarCruz committed May 1, 2021
1 parent 0651b18 commit 999dde9
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 22 deletions.
10 changes: 9 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"root": true,
"parserOptions": { "sourceType": "script" },
"extends": ["./index.js", "./node.js", "./react.js"]
"extends": ["./index.js", "./node.js", "./react.js"],
"overrides": [
{
"files": ["./*.js", "bin/**/*"],
"rules": {
"node/no-unpublished-require": "error"
}
}
]
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

ESLint preset for QuITS apps

## \[0.5.3] - 2021-05-01

### Changed

- In the `overrides` block of the .eslintrc.json generated by `quits-eslint-init`:
- Add "`./*.js`" to include JS files in the root.
- Add "`rollup.config.js,scripts/**.**/*.ts`" to enable ES6 `import`/`export` directives.
- Separate "`bin/**/*`" to enable [node/no-unpublished-require](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-require.md) as error.
- Move "confusing-browser-globals" from `dependencies` to `devDependencies`.
- Include files in the root and "bin" folders in the test.
- Update Readme.

### Removed

- [node/no-unpublished-require](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-require.md), since this rule only makes sense in the "bin" folder.

## \[0.5.2] - 2021-04-29

### Fixed
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![License][license-badge]][license-url]
[![npm Version][npm-badge]][npm-url]

[ESLint](https://eslint.org/) configuration with embeded support for [TypeScript](https://www.typescriptlang.org/) and [Prettierx](https://www.npmjs.com/package/prettierx) to be used in modern browsers, almost compatible with [StandardJS](https://standardjs.com/).
[ESLint](https://eslint.org/) configuration with embeded support for [TypeScript](https://www.typescriptlang.org/) and [Prettierx](https://www.npmjs.com/package/prettierx) to be used in modern browsers\*, almost compatible with [StandardJS](https://standardjs.com/).

Includes extra configurations for [React](https://reactjs.org/), [Preact](https://preactjs.com/) and [Node.js](https://nodejs.org/en/).

Expand All @@ -13,6 +13,8 @@ Includes extra configurations for [React](https://reactjs.org/), [Preact](https:
- TypeScript 4
- NodeJS 10.13 or 12 and later

\* A good [browserslist](https://github.com/browserslist/browserslist#best-practices) to start with is "`>= 0.15% and since 2019`" as you can [see here](https://browserslist.dev/?q=Pj0gMC4xNSUgYW5kIHNpbmNlIDIwMTk%3D).

## Included Plugins

- [@typescript-eslint](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
Expand Down Expand Up @@ -43,7 +45,7 @@ Run with `npx` or `yarn` from the root of your project:
npx quits-eslint-init
```

Review and customize the generated .eslintrc.json, .prettierrc.json and .vscode/settings.json files.
Review and customize the generated [.eslintrc.json](https://eslint.org/docs/user-guide/configuring/configuration-files), [.prettierrc.json](https://prettier.io/docs/en/configuration.html) and [.vscode/settings.json](https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations) files.

The only required setting is `extends` in the .eslintrc file:

Expand All @@ -55,7 +57,7 @@ The only required setting is `extends` in the .eslintrc file:

### Extra Configurations

Add to `extends[]` the configs for your environment:
Add to `extends[]` the configurations that match your environment:

| Package | Configuration |
| ------------------ | ----------------------------------- |
Expand All @@ -64,7 +66,7 @@ Add to `extends[]` the configs for your environment:
| preact | `@quitsmx/eslint-config/preact` |
| TypeScript runtime | `@quitsmx/eslint-config/ts-runtime` |

For the TypeScript runtime you need to set the proyect in your ESLint config.
For the TypeScript runtime you need to set the project in your ESLint config.
For example:

```json
Expand All @@ -79,7 +81,8 @@ For example:
### Prettierx

Configure Prettierx with a `.prettierrc.json` file in the root of your project.
For example, this config used by QuITS.mx, is almost the same as StandardJS:

For example, this preset used by QuITS.mx, wich we call "standardize", is similar to the one used by StandardJS:

```json
{
Expand Down
16 changes: 15 additions & 1 deletion bin/quits-eslint-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,23 @@ const eslintConf = {
ignorePatterns: ['/dist', '/patches'],
overrides: [
{
files: ['bin/**/*', 'scripts/**/*'],
files: ['bin/**/*'],
parserOptions: { sourceType: 'script' },
extends: ['@quitsmx/eslint-config/node'],
rules: {
'node/no-unpublished-require': 'error',
},
},
{
files: ['./*.js', 'scripts/**/*'],
parserOptions: { sourceType: 'script' },
extends: ['@quitsmx/eslint-config/node'],
},
{
files: ['rollup.config.js', 'scripts/**/*.ts'],
rules: {
'node/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }],
},
},
],
}
Expand Down
1 change: 0 additions & 1 deletion dist/eslintrc-node.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"node/no-new-require": "error",
"node/no-path-concat": "error",
"node/no-unpublished-bin": "error",
"node/no-unpublished-require": "error",
"node/no-unsupported-features/es-builtins": "error",
"node/no-unsupported-features/es-syntax": "error",
"node/no-unsupported-features/node-builtins": "error",
Expand Down
10 changes: 0 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
/*
Configuración para ESLint 7.x
El soporte preact se basa en react con los siguientes cambios:
- 'react/no-did-update-set-state': ON,
- 'react/no-unknown-property': [ON, { ignore: ['class', 'for'] }]
@date 2019-02-28T03:48:11.238Z
*/
module.exports = require('./dist/eslintrc.json')
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@quitsmx/eslint-config",
"description": "Customized ESLint config for TypeScript + React or Preact + Prettierx",
"version": "0.5.2",
"version": "0.5.3",
"main": "index.js",
"author": "aMarCruz <amarcruzbox-git@yahoo.com>",
"license": "MIT",
Expand Down Expand Up @@ -44,15 +44,14 @@
},
"scripts": {
"build": "node scripts/create-configs",
"test": "eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx scripts test",
"test": "eslint -f unix --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx .",
"list:config": "eslint --print-config",
"list:deprecated": "eslint-find-rules -n -d .eslintrc.json",
"list:unused": "node ./scripts/list-unused.js"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "~4.22.0",
"@typescript-eslint/parser": "~4.22.0",
"confusing-browser-globals": "^1.0.10",
"eslint-plugin-compat": "~3.9.0",
"eslint-plugin-node": "~11.1.0",
"eslint-plugin-prettierx": "~0.18.0",
Expand All @@ -67,6 +66,7 @@
"@types/node": "~15.0.1",
"@types/prettier": "~2.2.3",
"@types/react": "~17.0.4",
"confusing-browser-globals": "^1.0.10",
"eslint": "~7.25.0",
"eslint-config-prettier": "~8.3.0",
"eslint-config-standard": "~16.0.2",
Expand Down
1 change: 0 additions & 1 deletion scripts/base/conf-base-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module.exports = {
'node/no-missing-require': ON,
'node/no-mixed-requires': WARN,
'node/no-unpublished-bin': ON,
'node/no-unpublished-require': ON,
'node/no-unsupported-features/es-builtins': ON,
'node/no-unsupported-features/es-syntax': ON,
'node/no-unsupported-features/node-builtins': ON,
Expand Down

0 comments on commit 999dde9

Please sign in to comment.