Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable permissive max-len and max-lines as warning #84

Merged
merged 7 commits into from
Jul 28, 2024
Merged

Conversation

fregante
Copy link
Member

@fregante fregante commented Nov 17, 2023

I think it might make sense to enable them as warning to look at the pushback without creating too much trouble.

I think 200ch is a good upper limit, but I'm not sure about "1000 lines", especially in files with inline documentation and licensing.

https://eslint.org/docs/v8.x/rules/max-lines
https://eslint.org/docs/v8.x/rules/max-len

@sindresorhus
Copy link
Member

I think 2000 lines is too little.

@fregante
Copy link
Member Author

fregante commented Jun 8, 2024

The point of this warning is to push people to split up larger files. Even you reach the limit, you can just disable it in the file, hopefully as an exception rather than a common occurrence.

2000-lines is already excessive to me, but it could be a start to verify any pushback.

@fregante
Copy link
Member Author

For the record, this is what a 3000-lines file looks like. In a world of modules, this file would not have any reason to exist.

https://github.com/joshuacline/windick/blob/main/windick.cmd

index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
fregante and others added 3 commits July 28, 2024 13:40
Co-authored-by: Federico Brigante <me@fregante.com>
@sindresorhus sindresorhus merged commit e669d26 into main Jul 28, 2024
6 checks passed
@sindresorhus sindresorhus deleted the max branch July 28, 2024 10:10
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Aug 20, 2024
##### [v0.46.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.46.0)

##### New rules

-   [`@stylistic/indent-binary-ops`](https://eslint.style/rules/plus/indent-binary-ops)  [`d91defd`](xojs/eslint-config-xo@d91defd)
-   [`@stylistic/function-paren-newline`](https://eslint.style/rules/js/function-paren-newline)  [`fb5e204`](xojs/eslint-config-xo@fb5e204)
-   [`@stylistic/block-spacing`](https://eslint.style/rules/js/block-spacing)  [`cb6b443`](xojs/eslint-config-xo@cb6b443)
-   [`@stylistic/multiline-ternary`](https://eslint.style/rules/js/multiline-ternary)  [`3dea281`](xojs/eslint-config-xo@3dea281)

##### Breaking

-   Require Node.js 18.18
-   Migrate to flat config and require ESLint 9 ([#86](xojs/eslint-config-xo#86))  [`ec210f2`](xojs/eslint-config-xo@ec210f2)
    -   Migrate config: https://eslint.org/docs/latest/use/configure/migration-guide

##### Improvements

-   Migrate deprecated rules to [`@stylistic`](https://eslint.style)  [`0f81063`](xojs/eslint-config-xo@0f81063)
-   Enable permissive `max-len` and `max-lines` as warning ([#84](xojs/eslint-config-xo#84))  [`e669d26`](xojs/eslint-config-xo@e669d26)
-   Revert "Add option to `no-extra-boolean-cast`" ([#87](xojs/eslint-config-xo#87))  [`f010b63`](xojs/eslint-config-xo@f010b63)
-   Add option to `no-extra-boolean-cast`  [`a6dc171`](xojs/eslint-config-xo@a6dc171)
##### [v0.45.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.45.0)

-   Allow class fields with no blank lines between ([#85](xojs/eslint-config-xo#85))  [`6f2ff13`](xojs/eslint-config-xo@6f2ff13)
##### [v0.44.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.44.0)

##### Breaking

-   Require Node.js 18  [`f2060de`](xojs/eslint-config-xo@f2060de)

##### New rules

-   [`logical-assignment-operators`](https://eslint.org/docs/latest/rules/logical-assignment-operators)  [`27049c1`](xojs/eslint-config-xo@27049c1)
-   [`prefer-object-has-own`](https://eslint.org/docs/latest/rules/prefer-object-has-own)  [`288a3ca`](xojs/eslint-config-xo@288a3ca)
-   [`object-curly-newline`](https://eslint.org/docs/latest/rules/object-curly-newline) ([#83](xojs/eslint-config-xo#83))  [`3a5448b`](xojs/eslint-config-xo@3a5448b)

##### Improvements

-   Ban `atob` and `btoa`  [`dfa969c`](xojs/eslint-config-xo@dfa969c)
-   Replace deprecated `no-new-object` rule  [`7f8f92e`](xojs/eslint-config-xo@7f8f92e)
-   `no-unused-vars`: Allow ignoring variables by prefixing with underscore  [`b31ab8a`](xojs/eslint-config-xo@b31ab8a)
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Aug 20, 2024
##### [v0.46.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.46.0)

##### New rules

-   [`@stylistic/indent-binary-ops`](https://eslint.style/rules/plus/indent-binary-ops)  [`d91defd`](xojs/eslint-config-xo@d91defd)
-   [`@stylistic/function-paren-newline`](https://eslint.style/rules/js/function-paren-newline)  [`fb5e204`](xojs/eslint-config-xo@fb5e204)
-   [`@stylistic/block-spacing`](https://eslint.style/rules/js/block-spacing)  [`cb6b443`](xojs/eslint-config-xo@cb6b443)
-   [`@stylistic/multiline-ternary`](https://eslint.style/rules/js/multiline-ternary)  [`3dea281`](xojs/eslint-config-xo@3dea281)

##### Breaking

-   Require Node.js 18.18
-   Migrate to flat config and require ESLint 9 ([#86](xojs/eslint-config-xo#86))  [`ec210f2`](xojs/eslint-config-xo@ec210f2)
    -   Migrate config: https://eslint.org/docs/latest/use/configure/migration-guide

##### Improvements

-   Migrate deprecated rules to [`@stylistic`](https://eslint.style)  [`0f81063`](xojs/eslint-config-xo@0f81063)
-   Enable permissive `max-len` and `max-lines` as warning ([#84](xojs/eslint-config-xo#84))  [`e669d26`](xojs/eslint-config-xo@e669d26)
-   Revert "Add option to `no-extra-boolean-cast`" ([#87](xojs/eslint-config-xo#87))  [`f010b63`](xojs/eslint-config-xo@f010b63)
-   Add option to `no-extra-boolean-cast`  [`a6dc171`](xojs/eslint-config-xo@a6dc171)
##### [v0.45.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.45.0)

-   Allow class fields with no blank lines between ([#85](xojs/eslint-config-xo#85))  [`6f2ff13`](xojs/eslint-config-xo@6f2ff13)
##### [v0.44.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.44.0)

##### Breaking

-   Require Node.js 18  [`f2060de`](xojs/eslint-config-xo@f2060de)

##### New rules

-   [`logical-assignment-operators`](https://eslint.org/docs/latest/rules/logical-assignment-operators)  [`27049c1`](xojs/eslint-config-xo@27049c1)
-   [`prefer-object-has-own`](https://eslint.org/docs/latest/rules/prefer-object-has-own)  [`288a3ca`](xojs/eslint-config-xo@288a3ca)
-   [`object-curly-newline`](https://eslint.org/docs/latest/rules/object-curly-newline) ([#83](xojs/eslint-config-xo#83))  [`3a5448b`](xojs/eslint-config-xo@3a5448b)

##### Improvements

-   Ban `atob` and `btoa`  [`dfa969c`](xojs/eslint-config-xo@dfa969c)
-   Replace deprecated `no-new-object` rule  [`7f8f92e`](xojs/eslint-config-xo@7f8f92e)
-   `no-unused-vars`: Allow ignoring variables by prefixing with underscore  [`b31ab8a`](xojs/eslint-config-xo@b31ab8a)
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Aug 20, 2024
##### [v0.46.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.46.0)

##### New rules

-   [`@stylistic/indent-binary-ops`](https://eslint.style/rules/plus/indent-binary-ops)  [`d91defd`](xojs/eslint-config-xo@d91defd)
-   [`@stylistic/function-paren-newline`](https://eslint.style/rules/js/function-paren-newline)  [`fb5e204`](xojs/eslint-config-xo@fb5e204)
-   [`@stylistic/block-spacing`](https://eslint.style/rules/js/block-spacing)  [`cb6b443`](xojs/eslint-config-xo@cb6b443)
-   [`@stylistic/multiline-ternary`](https://eslint.style/rules/js/multiline-ternary)  [`3dea281`](xojs/eslint-config-xo@3dea281)

##### Breaking

-   Require Node.js 18.18
-   Migrate to flat config and require ESLint 9 ([#86](xojs/eslint-config-xo#86))  [`ec210f2`](xojs/eslint-config-xo@ec210f2)
    -   Migrate config: https://eslint.org/docs/latest/use/configure/migration-guide

##### Improvements

-   Migrate deprecated rules to [`@stylistic`](https://eslint.style)  [`0f81063`](xojs/eslint-config-xo@0f81063)
-   Enable permissive `max-len` and `max-lines` as warning ([#84](xojs/eslint-config-xo#84))  [`e669d26`](xojs/eslint-config-xo@e669d26)
-   Revert "Add option to `no-extra-boolean-cast`" ([#87](xojs/eslint-config-xo#87))  [`f010b63`](xojs/eslint-config-xo@f010b63)
-   Add option to `no-extra-boolean-cast`  [`a6dc171`](xojs/eslint-config-xo@a6dc171)
##### [v0.45.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.45.0)

-   Allow class fields with no blank lines between ([#85](xojs/eslint-config-xo#85))  [`6f2ff13`](xojs/eslint-config-xo@6f2ff13)
##### [v0.44.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.44.0)

##### Breaking

-   Require Node.js 18  [`f2060de`](xojs/eslint-config-xo@f2060de)

##### New rules

-   [`logical-assignment-operators`](https://eslint.org/docs/latest/rules/logical-assignment-operators)  [`27049c1`](xojs/eslint-config-xo@27049c1)
-   [`prefer-object-has-own`](https://eslint.org/docs/latest/rules/prefer-object-has-own)  [`288a3ca`](xojs/eslint-config-xo@288a3ca)
-   [`object-curly-newline`](https://eslint.org/docs/latest/rules/object-curly-newline) ([#83](xojs/eslint-config-xo#83))  [`3a5448b`](xojs/eslint-config-xo@3a5448b)

##### Improvements

-   Ban `atob` and `btoa`  [`dfa969c`](xojs/eslint-config-xo@dfa969c)
-   Replace deprecated `no-new-object` rule  [`7f8f92e`](xojs/eslint-config-xo@7f8f92e)
-   `no-unused-vars`: Allow ignoring variables by prefixing with underscore  [`b31ab8a`](xojs/eslint-config-xo@b31ab8a)
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Aug 21, 2024
##### [v0.46.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.46.0)

##### New rules

-   [`@stylistic/indent-binary-ops`](https://eslint.style/rules/plus/indent-binary-ops)  [`d91defd`](xojs/eslint-config-xo@d91defd)
-   [`@stylistic/function-paren-newline`](https://eslint.style/rules/js/function-paren-newline)  [`fb5e204`](xojs/eslint-config-xo@fb5e204)
-   [`@stylistic/block-spacing`](https://eslint.style/rules/js/block-spacing)  [`cb6b443`](xojs/eslint-config-xo@cb6b443)
-   [`@stylistic/multiline-ternary`](https://eslint.style/rules/js/multiline-ternary)  [`3dea281`](xojs/eslint-config-xo@3dea281)

##### Breaking

-   Require Node.js 18.18
-   Migrate to flat config and require ESLint 9 ([#86](xojs/eslint-config-xo#86))  [`ec210f2`](xojs/eslint-config-xo@ec210f2)
    -   Migrate config: https://eslint.org/docs/latest/use/configure/migration-guide

##### Improvements

-   Migrate deprecated rules to [`@stylistic`](https://eslint.style)  [`0f81063`](xojs/eslint-config-xo@0f81063)
-   Enable permissive `max-len` and `max-lines` as warning ([#84](xojs/eslint-config-xo#84))  [`e669d26`](xojs/eslint-config-xo@e669d26)
-   Revert "Add option to `no-extra-boolean-cast`" ([#87](xojs/eslint-config-xo#87))  [`f010b63`](xojs/eslint-config-xo@f010b63)
-   Add option to `no-extra-boolean-cast`  [`a6dc171`](xojs/eslint-config-xo@a6dc171)
##### [v0.45.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.45.0)

-   Allow class fields with no blank lines between ([#85](xojs/eslint-config-xo#85))  [`6f2ff13`](xojs/eslint-config-xo@6f2ff13)
##### [v0.44.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.44.0)

##### Breaking

-   Require Node.js 18  [`f2060de`](xojs/eslint-config-xo@f2060de)

##### New rules

-   [`logical-assignment-operators`](https://eslint.org/docs/latest/rules/logical-assignment-operators)  [`27049c1`](xojs/eslint-config-xo@27049c1)
-   [`prefer-object-has-own`](https://eslint.org/docs/latest/rules/prefer-object-has-own)  [`288a3ca`](xojs/eslint-config-xo@288a3ca)
-   [`object-curly-newline`](https://eslint.org/docs/latest/rules/object-curly-newline) ([#83](xojs/eslint-config-xo#83))  [`3a5448b`](xojs/eslint-config-xo@3a5448b)

##### Improvements

-   Ban `atob` and `btoa`  [`dfa969c`](xojs/eslint-config-xo@dfa969c)
-   Replace deprecated `no-new-object` rule  [`7f8f92e`](xojs/eslint-config-xo@7f8f92e)
-   `no-unused-vars`: Allow ignoring variables by prefixing with underscore  [`b31ab8a`](xojs/eslint-config-xo@b31ab8a)
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Aug 21, 2024
##### [v0.46.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.46.0)

##### New rules

-   [`@stylistic/indent-binary-ops`](https://eslint.style/rules/plus/indent-binary-ops)  [`d91defd`](xojs/eslint-config-xo@d91defd)
-   [`@stylistic/function-paren-newline`](https://eslint.style/rules/js/function-paren-newline)  [`fb5e204`](xojs/eslint-config-xo@fb5e204)
-   [`@stylistic/block-spacing`](https://eslint.style/rules/js/block-spacing)  [`cb6b443`](xojs/eslint-config-xo@cb6b443)
-   [`@stylistic/multiline-ternary`](https://eslint.style/rules/js/multiline-ternary)  [`3dea281`](xojs/eslint-config-xo@3dea281)

##### Breaking

-   Require Node.js 18.18
-   Migrate to flat config and require ESLint 9 ([#86](xojs/eslint-config-xo#86))  [`ec210f2`](xojs/eslint-config-xo@ec210f2)
    -   Migrate config: https://eslint.org/docs/latest/use/configure/migration-guide

##### Improvements

-   Migrate deprecated rules to [`@stylistic`](https://eslint.style)  [`0f81063`](xojs/eslint-config-xo@0f81063)
-   Enable permissive `max-len` and `max-lines` as warning ([#84](xojs/eslint-config-xo#84))  [`e669d26`](xojs/eslint-config-xo@e669d26)
-   Revert "Add option to `no-extra-boolean-cast`" ([#87](xojs/eslint-config-xo#87))  [`f010b63`](xojs/eslint-config-xo@f010b63)
-   Add option to `no-extra-boolean-cast`  [`a6dc171`](xojs/eslint-config-xo@a6dc171)
##### [v0.45.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.45.0)

-   Allow class fields with no blank lines between ([#85](xojs/eslint-config-xo#85))  [`6f2ff13`](xojs/eslint-config-xo@6f2ff13)
##### [v0.44.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.44.0)

##### Breaking

-   Require Node.js 18  [`f2060de`](xojs/eslint-config-xo@f2060de)

##### New rules

-   [`logical-assignment-operators`](https://eslint.org/docs/latest/rules/logical-assignment-operators)  [`27049c1`](xojs/eslint-config-xo@27049c1)
-   [`prefer-object-has-own`](https://eslint.org/docs/latest/rules/prefer-object-has-own)  [`288a3ca`](xojs/eslint-config-xo@288a3ca)
-   [`object-curly-newline`](https://eslint.org/docs/latest/rules/object-curly-newline) ([#83](xojs/eslint-config-xo#83))  [`3a5448b`](xojs/eslint-config-xo@3a5448b)

##### Improvements

-   Ban `atob` and `btoa`  [`dfa969c`](xojs/eslint-config-xo@dfa969c)
-   Replace deprecated `no-new-object` rule  [`7f8f92e`](xojs/eslint-config-xo@7f8f92e)
-   `no-unused-vars`: Allow ignoring variables by prefixing with underscore  [`b31ab8a`](xojs/eslint-config-xo@b31ab8a)
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Aug 21, 2024
##### [v0.46.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.46.0)

##### New rules

-   [`@stylistic/indent-binary-ops`](https://eslint.style/rules/plus/indent-binary-ops)  [`d91defd`](xojs/eslint-config-xo@d91defd)
-   [`@stylistic/function-paren-newline`](https://eslint.style/rules/js/function-paren-newline)  [`fb5e204`](xojs/eslint-config-xo@fb5e204)
-   [`@stylistic/block-spacing`](https://eslint.style/rules/js/block-spacing)  [`cb6b443`](xojs/eslint-config-xo@cb6b443)
-   [`@stylistic/multiline-ternary`](https://eslint.style/rules/js/multiline-ternary)  [`3dea281`](xojs/eslint-config-xo@3dea281)

##### Breaking

-   Require Node.js 18.18
-   Migrate to flat config and require ESLint 9 ([#86](xojs/eslint-config-xo#86))  [`ec210f2`](xojs/eslint-config-xo@ec210f2)
    -   Migrate config: https://eslint.org/docs/latest/use/configure/migration-guide

##### Improvements

-   Migrate deprecated rules to [`@stylistic`](https://eslint.style)  [`0f81063`](xojs/eslint-config-xo@0f81063)
-   Enable permissive `max-len` and `max-lines` as warning ([#84](xojs/eslint-config-xo#84))  [`e669d26`](xojs/eslint-config-xo@e669d26)
-   Revert "Add option to `no-extra-boolean-cast`" ([#87](xojs/eslint-config-xo#87))  [`f010b63`](xojs/eslint-config-xo@f010b63)
-   Add option to `no-extra-boolean-cast`  [`a6dc171`](xojs/eslint-config-xo@a6dc171)
##### [v0.45.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.45.0)

-   Allow class fields with no blank lines between ([#85](xojs/eslint-config-xo#85))  [`6f2ff13`](xojs/eslint-config-xo@6f2ff13)
##### [v0.44.0](https://github.com/xojs/eslint-config-xo/releases/tag/v0.44.0)

##### Breaking

-   Require Node.js 18  [`f2060de`](xojs/eslint-config-xo@f2060de)

##### New rules

-   [`logical-assignment-operators`](https://eslint.org/docs/latest/rules/logical-assignment-operators)  [`27049c1`](xojs/eslint-config-xo@27049c1)
-   [`prefer-object-has-own`](https://eslint.org/docs/latest/rules/prefer-object-has-own)  [`288a3ca`](xojs/eslint-config-xo@288a3ca)
-   [`object-curly-newline`](https://eslint.org/docs/latest/rules/object-curly-newline) ([#83](xojs/eslint-config-xo#83))  [`3a5448b`](xojs/eslint-config-xo@3a5448b)

##### Improvements

-   Ban `atob` and `btoa`  [`dfa969c`](xojs/eslint-config-xo@dfa969c)
-   Replace deprecated `no-new-object` rule  [`7f8f92e`](xojs/eslint-config-xo@7f8f92e)
-   `no-unused-vars`: Allow ignoring variables by prefixing with underscore  [`b31ab8a`](xojs/eslint-config-xo@b31ab8a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reintroduce "length" rules to catch excess
2 participants