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

seekingalpha-javascript-style ver. 5.38.13 #384

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ module.exports = {
node: true,
},
reportUnusedDisableDirectives: true,
extends: ['eslint-config-seekingalpha-base/prettier', 'eslint-config-seekingalpha-node'],
extends: [
'eslint-config-seekingalpha-base/prettier',
'eslint-config-seekingalpha-node',
],
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// eslint-plugin-import rules (https://github.com/benmosher/eslint-plugin-import)

module.exports = {
extends: ['./helpful-warnings.js', './module-systems.js', './static-analysis.js', './style-guide.js'],
extends: [
'./helpful-warnings.js',
'./module-systems.js',
'./static-analysis.js',
'./style-guide.js',
],

plugins: ['import'],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ module.exports = {
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'unknown', 'index', 'type'],
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'unknown',
'index',
'type',
],

'newlines-between': 'always',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module.exports = {
extends: ['./possible-problems.js', './suggestions.js', './layout-and-formatting.js'],
extends: [
'./possible-problems.js',
'./suggestions.js',
'./layout-and-formatting.js',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ module.exports = {
'no-restricted-syntax': [
'error',
{
selector: 'CallExpression[callee.name="setTimeout"][arguments.length!=2]',
selector:
'CallExpression[callee.name="setTimeout"][arguments.length!=2]',
message: 'setTimeout must always be invoked with two arguments.',
},
{
Expand All @@ -446,7 +447,8 @@ module.exports = {
},
{
selector: 'LabeledStatement',
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
message:
'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,39 @@ module.exports = {
'jsx-a11y/no-noninteractive-element-interactions': [
'error',
{
handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
handlers: [
'onClick',
'onMouseDown',
'onMouseUp',
'onKeyPress',
'onKeyDown',
'onKeyUp',
],
},
],

// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-element-to-interactive-role.md
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
'error',
{
ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
ul: [
'listbox',
'menu',
'menubar',
'radiogroup',
'tablist',
'tree',
'treegrid',
],
ol: [
'listbox',
'menu',
'menubar',
'radiogroup',
'tablist',
'tree',
'treegrid',
],
li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
table: ['grid'],
td: ['gridcell'],
Expand Down Expand Up @@ -206,7 +229,14 @@ module.exports = {
'jsx-a11y/no-static-element-interactions': [
'error',
{
handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
handlers: [
'onClick',
'onMouseDown',
'onMouseUp',
'onKeyPress',
'onKeyDown',
'onKeyUp',
],
},
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module.exports = {
{
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
rule: '^(is|has|should)[A-Z]([A-Za-z0-9]?)+',
message: 'It is better if your prop ({{ propName }}) matches this pattern: ({{ pattern }})',
message:
'It is better if your prop ({{ propName }}) matches this pattern: ({{ pattern }})',
},
],

Expand Down Expand Up @@ -302,7 +303,16 @@ module.exports = {
'react/sort-comp': [
'error',
{
order: ['static-methods', 'lifecycle', '/^on.+$/', 'getters', 'setters', 'instance-methods', 'everything-else', 'rendering'],
order: [
'static-methods',
'lifecycle',
'/^on.+$/',
'getters',
'setters',
'instance-methods',
'everything-else',
'rendering',
],
groups: {
lifecycle: [
'displayName',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ module.exports = {

'@typescript-eslint/class-literal-property-style': ['error', 'fields'],

'@typescript-eslint/consistent-generic-constructors': ['error', 'constructor'],
'@typescript-eslint/consistent-generic-constructors': [
'error',
'constructor',
],

'@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seekingalpha-javascript-style",
"version": "5.38.12",
"version": "5.38.13",
"description": "Set of linting rules, guides and best practices for best Javascript code",
"main": "index.js",
"type": "module",
Expand Down Expand Up @@ -45,16 +45,16 @@
]
},
"devDependencies": {
"@seekingalpha/prettier-config-samw": "1.2.0",
"@seekingalpha/prettier-config-samw": "2.0.0",
"eslint": "8.57.0",
"eslint-config-seekingalpha-base": "7.16.0",
"eslint-config-seekingalpha-base": "8.0.0",
"eslint-config-seekingalpha-node": "5.54.0",
"eslint-plugin-array-func": "4.0.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-no-use-extend-native": "0.5.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-unicorn": "51.0.1",
"eslint-plugin-unicorn": "52.0.0",
"husky": "9.0.11",
"lint-staged": "15.2.2",
"prettier": "3.2.5"
Expand Down