-
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
Open
ezej4
wants to merge
83
commits into
main
Choose a base branch
from
feature/es-lint-migration-v9
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
4807fc3
Bump the eslint group with 4 updates
dependabot[bot] f627cb5
some progress
70c0fce
solve errors
20c61d5
solve conflicts
800d1a0
install formats prettier
ac8cc42
v3.0.1-beta
210697f
solve conflicts
3905f2d
fix
7455a52
v3.0.1-beta-1
617a7b5
name all configs
3ab110b
v3.0.1-beta-2
8d280ed
fix jest config
1cdeb77
v3.0.1-beta-3
b34359e
fix again
d506175
v3.0.1-beta-4
d5bf2fb
v3.0.1-beta-5
dd89585
fix excluded file ts
cff76a0
v3.0.1-beta-6
1a63c33
migrate to ES Mmodules syntax
8e5f873
v3.0.1-beta-7
536325a
v3.0.1-beta-8
f5c83b3
ts configs
094c9aa
remove
694de07
refactor ts configs
c7cae3e
v3.0.1-beta-9
54ce43d
add logs
f2a455d
v3.0.1-beta-10
c2a784f
test
20f9e2c
v3.0.1-beta-11
051e247
another fix
ebf0128
v3.0.1-beta-12
f1c790b
another test
5f24769
v3.0.1-beta-13
afa2424
change import pluging
b91eea7
v3.0.1-beta-14
bdfe4d2
change import pluging
e946ec8
v3.0.1-beta-15
998d7a7
update readme
d9d4849
v3.0.1-beta-16
dc11ca4
resolve conflicts
e311088
add compatibility with common-js
1fc5cc4
v3.0.1-beta-17
d201a1e
fix
03c12e5
v3.0.1-beta-18
5f1d7fe
add vite to transpile to es,cjs
9c9d38c
v3.0.1-beta-19
c836106
test change workflow
4b20c84
v3.0.1-beta-20
21bb5ca
fix
8090d20
v3.0.1-beta-21
13219cf
add forced dist
f5e93aa
v3.0.1-beta-22
c3d1f24
fix pipelines
68c2a1f
v3.0.1-beta-23
ad07122
restore
3269e91
v3.0.1-beta-24
70f1117
fix build
cdc48c8
v3.0.1-beta-25
c99bb7f
change compilation process
a1a5ec4
v3.0.1-beta-26
28f4e23
fix
7df8864
v3.0.1-beta-27
b806759
another try
b9443db
v3.0.1-beta-28
bf1bac0
and another one
5548676
v3.0.1-beta-29
21df9a0
m
f2639ab
try compilation process again
3fcb249
fix
0fcdbca
v3.0.1-beta-30
16aa3fd
fix compilation process
bc54c9f
v3.0.1-beta-31
475a7c2
fix again
b555084
v3.0.1-beta-32
b51038b
some fixes
d1ed302
v3.0.1-beta-33
0f38621
another fix
4d06c3b
v3.0.1-beta-34
0ead64c
fix lint
038551a
update with remote
b98c1b1
add changelog
1177653
fix es6 version import
84dcb04
v3.0.1-beta-35
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,6 @@ bower_components/ | |
# VSCode | ||
.vscode/ | ||
|
||
dist/ | ||
es2015/ | ||
dev-build/ | ||
# Local env variables | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/node_modules | ||
/dist | ||
*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,80 @@ | ||
const { isPackageAvailable } = require('../utils'); | ||
/* eslint-disable prefer-destructuring */ | ||
/* eslint-disable global-require */ | ||
|
||
const isTSAvailable = isPackageAvailable('typescript'); | ||
const isJestAvailable = isPackageAvailable('jest'); | ||
/* eslint-disable import/extensions */ | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import globals from 'globals'; | ||
|
||
import bestPractices from './best-practices.js'; | ||
import errors from './errors.js'; | ||
import es6 from './es6.js'; | ||
import formats from './formats.js'; | ||
import imports from './imports.js'; | ||
import lodash from './lodash.js'; | ||
import node from './node.js'; | ||
import postcss from './postcss.js'; | ||
import promises from './promises.js'; | ||
import react from './react.js'; | ||
import reactA11y from './react-a11y.js'; | ||
import storybook from './storybook.js'; | ||
import strict from './strict.js'; | ||
import style from './style.js'; | ||
import variables from './variables.js'; | ||
|
||
let jestConfigs = {}; | ||
let tsConfigs = []; | ||
|
||
if (process.env.BUILD_FORMAT === 'es') { | ||
const { getConditionalPackages } = await import('./conditionalPackages.js'); | ||
const packages = await getConditionalPackages(); | ||
jestConfigs = packages.jestConfigs; | ||
tsConfigs = packages.tsConfigs; | ||
} | ||
|
||
if (process.env.BUILD_FORMAT === 'cjs') { | ||
const { getConditionalPackages } = require('./conditionalPackagesLegacy.cjs'); | ||
const packages = getConditionalPackages(); | ||
jestConfigs = packages.jestConfigs; | ||
tsConfigs = packages.tsConfigs; | ||
} | ||
|
||
const configs = [ | ||
'./best-practices', | ||
'./errors', | ||
'./es6', | ||
'./imports', | ||
'./node', | ||
'./promises', | ||
'./strict', | ||
'./style', | ||
'./variables', | ||
'./react', | ||
'./lodash', | ||
'./react-a11y', | ||
isJestAvailable && './jest', | ||
bestPractices, | ||
errors, | ||
es6, | ||
...imports, | ||
postcss, | ||
node, | ||
promises, | ||
strict, | ||
style, | ||
variables, | ||
react, | ||
reactA11y, | ||
formats, | ||
storybook, | ||
lodash, | ||
].filter(Boolean); | ||
|
||
const overrides = [ | ||
isTSAvailable && { | ||
files: ['**/*.ts', '**/*.tsx'], | ||
excludedFiles: '*.d.ts', | ||
extends: ['./ts'], | ||
}, | ||
const rules = [ | ||
...configs, | ||
{}, | ||
{ | ||
files: ['*.story.tsx', '*.stories.tsx'], | ||
extends: ['./storybook'], | ||
name: 'base-cabify-eslint-config', | ||
languageOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: 'module', | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
}, | ||
}, | ||
rules: { | ||
strict: 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['postcss.config.js'], | ||
extends: ['./postcss'], | ||
}, | ||
].filter(Boolean); | ||
{ ...jestConfigs }, | ||
...tsConfigs, | ||
eslintConfigPrettier, | ||
]; | ||
|
||
module.exports = { | ||
env: { | ||
browser: true, | ||
node: true, | ||
}, | ||
extends: configs, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
strict: 'error', | ||
}, | ||
overrides, | ||
}; | ||
export default rules; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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