Skip to content

Commit

Permalink
feat(eslint): making a couple of our internal custom rules open source (
Browse files Browse the repository at this point in the history
#871)

* feat: pulling across our `no-decorators-on-private-properties` rule

* feat: pulling across `prefer-unicode-ellipsis`

* feat: new `prefer-typescript` eslint rule

* fix: bringing back the bespoke plugin configs

* feat: introducing automatic doc generation

* fix: resolving some prettier issues

* chore: changing test case filenames

* Update packages/eslint-plugin/.eslint-doc-generatorrc.js

Co-authored-by: Kanad Gupta <[email protected]>

* fix: updating the docs

---------

Co-authored-by: Kanad Gupta <[email protected]>
  • Loading branch information
erunion and kanadgupta authored Aug 8, 2024
1 parent a4b17b4 commit 3d41bb5
Show file tree
Hide file tree
Showing 22 changed files with 802 additions and 27 deletions.
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.formatOnSave": true
}
277 changes: 275 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion packages/eslint-config/react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/** @type {import("eslint-define-config").ESLintConfig} */
const config = {
extends: ['plugin:jsx-a11y/recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended'],
extends: [
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:readme/react',
],
plugins: ['readme'],
env: {
browser: true,
},
Expand Down
9 changes: 7 additions & 2 deletions packages/eslint-config/typescript.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
/** @type {import("eslint-define-config").ESLintConfig} */
const config = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:typescript-sort-keys/recommended',
'plugin:readme/typescript',
],
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:typescript-sort-keys/recommended'],
parser: '@typescript-eslint/parser',
settings: {
'import/resolver': 'typescript',
},
Expand Down
15 changes: 15 additions & 0 deletions packages/eslint-plugin/.eslint-doc-generatorrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type {import('eslint-doc-generator').GenerateOptions} */
const config = {
configEmoji: [
['esm', '📁'],
['typescript', '🧠'],
['react', '⚛️'],
],
urlRuleDoc(name, page) {
if (page === 'README.md') {
return `https://github.com/readmeio/standards/tree/main/packages/eslint-plugin/docs/rules/${name}.md`;
}
},
};

module.exports = config;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2023 ReadMe
Copyright 2024 ReadMe

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

Expand Down
Loading

0 comments on commit 3d41bb5

Please sign in to comment.