You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,65 @@
1
1
# Changes for eslint-config-standardize
2
2
3
+
## \[0.9.0] - 2021-04-27
4
+
5
+
### added
6
+
7
+
-`no-return-await` as "warn"
8
+
-`no-useless-constructor` as "error"
9
+
-`node/no-unpublished-require` as "error"
10
+
-`node/shebang` as "error"
11
+
-`unicorn/no-array-push-push` as "warn"
12
+
-`unicorn/prefer-array-index-of` as "warn"
13
+
-`unicorn/prefer-date-now` as "warn"
14
+
-`@typescript-eslint/default-param-last` as "error" (extends the ESlint rule)
15
+
-`@typescript-eslint/no-dupe-class-members` as "error" (extends the ESlint rule)
16
+
-`@typescript-eslint/no-duplicate-imports` as "error" (extends the ESlint rule)
17
+
-`@typescript-eslint/no-redeclare` as "error" (extends the ESlint rule)
18
+
-`react/no-children-prop` as "error"
19
+
-`react/no-danger-with-children` as "error"
20
+
-`react/no-find-dom-node` as "error"
21
+
-`react/no-render-return-value` as "error"
22
+
-`react/no-this-in-sfc` as "error"
23
+
-`react/void-dom-elements-no-children` as "error"
24
+
-`react/jsx-no-bind` as "error"
25
+
-`react/jsx-no-target-blank` as "error" with `enforceDynamicLinks:always`
26
+
-`react/jsx-no-useless-fragment` as "error"
27
+
28
+
### Removed
29
+
30
+
-`no-restricted-syntax` as "WithStatement" is replaced with `no-with`
31
+
-`prefer-arrow-callback` (was "off")
32
+
-`@typescript-eslint/array-type` as it's too opinionated
33
+
-`import/named` (was "error")
34
+
35
+
### Changed
36
+
37
+
- Add `document`, `navigator`, `window` to ESLint `globals`, as StandardJS does.
38
+
- Add `convertPath` option to `settings/node` for "./src/bin" to "./bin" translation.
39
+
- Add options to allow "amd" in `import/no-absolute-path`
40
+
- Add `"#__INLINE__"` and `"#__NOINLINE__"` to markers of block in `spaced-comment`
41
+
- Add `noTemplateLiterals` option to `react/no-string-refs`
42
+
- Change `complexity` from 10 to 12
43
+
- Change `curly` from "error" to "warn"
44
+
- Change `commentPattern` from "^no ?default$" to "^no default$" (require space) in `default-case`.
45
+
- Change `react/jsx-max-depth` from 5 to 6
46
+
- Change `unicorn/no-unreadable-array-destructuring` from "error" to "warn"
47
+
- Change `unicorn/better-regex` from "error" to "warn"
48
+
- Replaced `unicorn/no-array-instanceof` with `unicorn/no-instanceof-array`
49
+
- Replaced `unicorn/prefer-text-content` with `unicorn/prefer-dom-node-text-content`
50
+
- Replaced `unicorn/prefer-node-remove` with `unicorn/prefer-dom-node-remove`
51
+
- Replaced `unicorn/prefer-event-key` with `unicorn/prefer-keyboard-event-key`
52
+
- Replaced `unicorn/prefer-starts-ends-with` with `unicorn/prefer-string-starts-ends-with`
53
+
- Revert `@typescript-eslint/member-delimiter-style` singleline delimiter to 'semi'
54
+
- Remove `allowInPropTypes` option from `react/forbid-foreign-prop-types`
55
+
- Remove `allowAllCaps` option in `react/jsx-pascal-case`
56
+
- Now the rules are extracted and prepared from the prettierx, standard, and standard-jsx configurations at build time, so its packages are not required at runtime and have been moved to `devDependencies`.
57
+
-[eslint-plugin-prettierx](https://www.npmjs.com/package/eslint-plugin-prettierx) is included and enabled in this package. You don't need to include the "eslint-plugin-prettierx/standardize-bundle" configuration.
58
+
- Scripts have been added to package.json to list obsolete and unused rules. This through the [eslint-find-rules](https://www.npmjs.com/package/eslint-find-rules) package.
59
+
- The rule `@typescript-eslint/naming-convention` has been relaxed to allow edge cases.
60
+
- Workaround for typescript-eslint/typescript-eslint#2540 bug with `no-use-before-define`.
Copy file name to clipboardExpand all lines: README.md
+28-43Lines changed: 28 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,30 @@
3
3
[![License][license-badge]][license-url]
4
4
[![npm Version][npm-badge]][npm-url]
5
5
6
-
For use with ESLint v7.17.0 and above, for previous versions use eslint-config-standardize 0.7.x or bellow.
6
+
## IMPORTANT
7
7
8
-
Minimum NodeJS version supported: 10.13, 12.0, or above (ESLint 7 compatible).
8
+
eslint-config-standardize was my first attempt to integrate ESLint with TypeScript and React. Currently, the package that my team and I use is [@quitsmx/eslint-config](https://github.com/quitsmx/eslint-config). With TypeScript and PrettierX integrated, this one is more modern and easier to use. I would recommend you give it a try, eslint-config-standardize will be discontinued soon.
9
+
10
+
---
11
+
12
+
Customizable ESLint config backed by [StandardJS](https://www.npmjs.com/package/eslint-config-standard) rules and [PrettierX](https://www.npmjs.com/package/prettierx) formatting.
13
+
14
+
For use with ESLint v7.0 and above, for previous versions use eslint-config-standardize 0.7.x or bellow.
15
+
16
+
Minimum Node.js version: 10.13, 12.0, or above.
17
+
18
+
**NOTE:**
19
+
20
+
From v0.9.0, [eslint-plugin-prettierx](https://www.npmjs.com/package/eslint-plugin-prettierx) is included and enabled in this package. You don't need to include the "eslint-plugin-prettierx/standardize-bundle" config.
9
21
10
22
## Setup
11
23
12
24
Install from npm (omit eslint if it's already installed or you are using CRA).
13
25
14
26
```sh
15
-
npm i eslint eslint-config-standardize -D
27
+
npm install -D eslint eslint-config-standardize
16
28
# or
17
-
yarn add eslint eslint-config-standardize -D
29
+
yarn add -D eslint eslint-config-standardize
18
30
```
19
31
20
32
In your ESLint config file:
@@ -29,13 +41,13 @@ module.exports = {
29
41
30
42
### With TypeScript
31
43
32
-
If you are using TypeScript, add "standardize/typescript" in "extends".
44
+
If you are using TypeScript, install the parser and the eslint plugin
Standardize uses a more strict and opinionated configuration than Standard, so almost all the code passes with no problems through the StandardJS linter, but has some differences with the default settings of StandardJS/Prettier.
78
+
Standardize uses a more strict and opinionated configuration than _StandardJS_ and include the react-hooks and unicorn plugins.
79
+
80
+
Almost all the code passes with no problems through the StandardJS linter, but has some differences with the default settings of StandardJS/PrettierX. This is the most important:
66
81
67
82
### Multiline Ternary
68
83
69
-
The formating of multiline ternary is a mess, altough the result seems to be inlined with the StandardJS rules. See [Known Issues](#known-issues).
84
+
The formatting of multiline ternary is a mess, although the result seems to be inline with the StandardJS rules. See [Known Issues](#known-issues).
70
85
71
86
### Trailing Commas
72
87
73
-
Altough StandardJS avoids trailing commas in all, this is a common practice as it helps to clarify commits.
88
+
Although _StandardJS_ avoids trailing commas in all, this is a common practice as it helps to clarify commits.
74
89
75
90
Standardize leaves everything to 'always', except for the function parameters (Prettier's `trailingComma: 'es5'` option).
76
91
@@ -84,14 +99,6 @@ The React style favors double quotes in properties, and I agree.
Both Prettier and StandardJS enclose the properties in quotes "as needed", this looks ugly with syntax highlighting on large JS objects (such as those used in configurations) and is inconsistent at object level. I prefer `"consistent"`.
The [eslint-plugin-prettierx](https://github.com/aMarCruz/eslint-plugin-prettierx) can be used to format JS code. It have a preset for the standardize bundle.
105
-
106
-
This example is using standardize with the prettierx plugin:
The [eslint-plugin-prettierx](https://github.com/aMarCruz/eslint-plugin-prettierx)**is used** to format the JS code. You don't need install PrettierX.
127
112
128
-
Done.
113
+
This plugin is a excellent alternative to the VS Code 'Prettier - Code formatter' extension.
129
114
130
-
This plugin is a excellent alternative to the VS Code 'Prettier - Code formatter' extension. See [here](https://github.com/aMarCruz/eslint-plugin-prettierx#vs-code-eslint) to know how to configure it.
115
+
See [here](https://github.com/aMarCruz/eslint-plugin-prettierx#vs-code-eslint) to know how to configure it.
0 commit comments