-
Notifications
You must be signed in to change notification settings - Fork 0
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
ESLint migration to v9 #414
base: main
Are you sure you want to change the base?
Changes from all commits
4807fc3
f627cb5
70c0fce
20c61d5
800d1a0
ac8cc42
210697f
3905f2d
7455a52
617a7b5
3ab110b
8d280ed
1cdeb77
b34359e
d506175
d5bf2fb
dd89585
cff76a0
1a63c33
8e5f873
536325a
f5c83b3
094c9aa
694de07
c7cae3e
54ce43d
f2a455d
c2a784f
20f9e2c
051e247
ebf0128
f1c790b
5f24769
afa2424
b91eea7
bdfe4d2
e946ec8
998d7a7
d9d4849
dc11ca4
e311088
1fc5cc4
d201a1e
03c12e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
const globals = require('globals'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't you use an ESmodule file for this? It question applies to all configuration files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see there are config files in ESmodule as well. I don't understand why we need to define the config in both formats 🤷 |
||
const { isPackageAvailable } = require('./utils.cjs'); | ||
const bestPractices = require('./best-practices.cjs'); | ||
const errors = require('./errors.cjs'); | ||
const es6 = require('./es6.cjs'); | ||
const formats = require('./formats.cjs'); | ||
const imports = require('./imports.cjs'); | ||
const jest = require('./jest.cjs'); | ||
const lodash = require('./lodash.cjs'); | ||
const node = require('./node.cjs'); | ||
const postcss = require('./postcss.cjs'); | ||
const promises = require('./promises.cjs'); | ||
const react = require('./react.cjs'); | ||
const reactA11y = require('./react-a11y.cjs'); | ||
const storybook = require('./storybook.cjs'); | ||
const strict = require('./strict.cjs'); | ||
const style = require('./style.cjs'); | ||
const variables = require('./variables.cjs'); | ||
|
||
const isTSAvailable = isPackageAvailable('typescript'); | ||
let tsConfigs = []; | ||
if (isTSAvailable) { | ||
// eslint-disable-next-line global-require | ||
const { tsLintConfig } = require('./ts.cjs'); | ||
tsConfigs = tsLintConfig; | ||
} | ||
const isJestAvailable = isPackageAvailable('jest'); | ||
|
||
const configs = [ | ||
bestPractices, | ||
errors, | ||
es6, | ||
...imports, | ||
node, | ||
promises, | ||
strict, | ||
style, | ||
variables, | ||
react, | ||
lodash, | ||
reactA11y, | ||
formats, | ||
storybook, | ||
postcss, | ||
isJestAvailable && jest, | ||
].filter(Boolean); | ||
|
||
module.exports = [ | ||
...configs, | ||
{ | ||
name: 'base-cabify-eslint-config', | ||
languageOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: 'module', | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
}, | ||
}, | ||
rules: { | ||
strict: 'error', | ||
}, | ||
}, | ||
...tsConfigs, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, review if we can define the config in a
ts
fileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the eslint doc create an
eslint.config.ts
is an experimental feature.In my opinion, we should keep the files as
.js
until we can configure without experimental options.ref1