Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
POS/api/eslint.config.js at develop · Posnic/POS · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
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
{{ message }}
Posnic
POS
Repository navigation
Code
Issues
396
(396)
Pull requests
14
(14)
Discussions
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
develop
Breadcrumbs
POS
/
api
/
eslint.config.js
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
118 lines (110 loc) · 4.49 KB
develop
Breadcrumbs
POS
/
api
/
eslint.config.js
Copy path
Top
File metadata and controls
Code
Blame
118 lines (110 loc) · 4.49 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
'use strict'
;
/*
* Lint rules for the API.
*
* `npm run lint` existed as a script long before this file did, with neither
* eslint nor a config installed, so a contributor's first command failed. The
* rules here are deliberately close to what the code already does: a linter
* that reports thousands of problems on a clean checkout teaches people to run
* it with their eyes closed.
*
* Formatting is left to Prettier; eslint-config-prettier turns off the rules
* that would otherwise argue with it.
*/
const
js
=
require
(
'@eslint/js'
)
;
const
globals
=
require
(
'globals'
)
;
const
prettier
=
require
(
'eslint-config-prettier'
)
;
module
.
exports
=
[
{
ignores
:
[
'node_modules/**'
,
'coverage/**'
,
'uploads/**'
,
'public/**'
,
'**/*.min.js'
]
,
}
,
js
.
configs
.
recommended
,
prettier
,
{
languageOptions
:
{
ecmaVersion
:
2022
,
sourceType
:
'commonjs'
,
globals
:
{
...
globals
.
node
,
...
globals
.
es2021
}
,
}
,
rules
:
{
// The codebase logs to the console in about 1,600 places. Making that an
// error today would bury every real finding, so it is a warning and a
// standing invitation to move to a real logger.
'no-console'
:
'warn'
,
/*
* Cleanliness, not correctness - warnings, so they stay visible without
* blocking a release.
*
* The split matters. Everything below under "real defects" is an error and
* the count is zero: no undefined variables, no assignments to constants,
* no duplicate object keys or class members, no branches that cannot run.
* Those were fixed one at a time, and several were live faults - a
* ReferenceError on every invalid login, a schema default silently
* discarded, a Mongo filter that excluded the wrong thing.
*
* What is left is 73 unused locals, 12 catch blocks that only rethrow and
* 10 empty blocks. None changes what the software does. Rewriting 99 sites
* across code that calculates what a shop charges, to satisfy rules about
* tidiness, is a poor trade: the risk is real and the benefit is
* readability. They are recorded here rather than deleted from the report,
* and the same reasoning already applies to no-console above.
*
* An unused argument is often a deliberate Express signature - above all
* the four-argument error handler - so only unused variables are counted.
*/
'no-unused-vars'
:
[
'warn'
,
{
args
:
'none'
,
caughtErrors
:
'none'
,
ignoreRestSiblings
:
true
,
}
,
]
,
'no-useless-catch'
:
'warn'
,
'no-empty'
:
'warn'
,
// These catch real defects rather than style.
eqeqeq
:
[
'error'
,
'always'
,
{
null
:
'ignore'
}
]
,
'no-var'
:
'error'
,
'prefer-const'
:
[
'error'
,
{
destructuring
:
'all'
}
]
,
'no-throw-literal'
:
'error'
,
'require-atomic-updates'
:
'off'
,
/*
* no-return-await is off, and this is a decision rather than an exemption.
*
* ESLint deprecated the rule in v8.46 - `rule.meta.deprecated` is true in
* the version installed here. It was written when `return await` cost an
* extra microtask for nothing; since Node 12 it is close to free, it gives
* a usable stack trace when the promise rejects, and inside a try block it
* is *required* - drop the await and the rejection escapes the try, so the
* catch never runs.
*
* It reported 160 times in this codebase. Rewriting 160 return statements
* in code that computes what a shop charges, to satisfy a rule its own
* maintainers withdrew, is risk bought with no benefit. None of the 160 is
* currently inside a try block, so the fixer would not have broken
* anything today - but that is a property of the code as it stands now,
* not a property anyone would maintain, and the next `return await` added
* inside a try is the one that matters.
*/
'no-return-await'
:
'off'
,
}
,
}
,
{
files
:
[
'src/kitchen-board/board.js'
,
'src/kitchen-board/device.js'
,
'src/kitchen-board/i18n.js'
,
]
,
languageOptions
:
{
sourceType
:
'script'
,
globals
:
globals
.
browser
}
,
}
,
{
files
:
[
'src/kitchen-board/sw.js'
]
,
languageOptions
:
{
sourceType
:
'script'
,
globals
:
globals
.
serviceworker
}
,
}
,
{
// Tests run under Jest and legitimately use its globals.
files
:
[
'tests/**/*.js'
]
,
languageOptions
:
{
globals
:
{
...
globals
.
node
,
...
globals
.
jest
}
}
,
rules
:
{
'no-console'
:
'off'
}
,
}
,
]
;
You can’t perform that action at this time.