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

Major update to eslint 9.x #6

Merged
merged 23 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ccbbc2e
remove unexpected storage of yarn cache
rosskevin Jun 25, 2024
98a2a08
remove yarn cache totally
rosskevin Jun 25, 2024
6084df3
WIP on major update to 9.x flat config
rosskevin Jun 25, 2024
5cdce79
finally discovered the seemingly unintuitive way to ignore files
rosskevin Jun 26, 2024
b568ac3
split configs into js vs other to separate file matching and applicat…
rosskevin Jun 26, 2024
cab430c
fix default inclusion of js kind in other
rosskevin Jun 26, 2024
33cb73a
wip [skip ci]
rosskevin Jun 27, 2024
457d442
differentiate js, json, md, and combined with recommended
rosskevin Jun 29, 2024
5aa7ef5
json lints alone
rosskevin Jun 29, 2024
a55aaaa
checkpoint [skip ci]
rosskevin Jun 29, 2024
cb993b6
lint:fix [skip ci]
rosskevin Jun 29, 2024
ce20932
basic @typescript-eslint runs [skip ci]
rosskevin Jun 29, 2024
76aa4b8
checkpoint working on legacy import plugin [skip ci]
rosskevin Jun 29, 2024
07a3462
swap out eslint-plugin-import for eslint-plugin-import-x [skip ci]
rosskevin Jun 30, 2024
8721c5a
checkpoint working so far, import-x, react-hooks, storybook added bac…
rosskevin Jun 30, 2024
e8d6cf3
added comments plugin [skip ci]
rosskevin Jun 30, 2024
c15e4dc
added simple import sort [skip ci]
rosskevin Jun 30, 2024
197ab23
added no unused imports [skip ci]
rosskevin Jun 30, 2024
efc826c
n plugin added [skip ci]
rosskevin Jun 30, 2024
9a6e4b1
added unicorn plugin [skip ci]
rosskevin Jun 30, 2024
ad1282f
js linting works, canary version of storybook plugin used now
rosskevin Jun 30, 2024
9dd93ea
added back rule comments - finally converted to flat config (with som…
rosskevin Jun 30, 2024
3218a3c
update ci to node 20
rosskevin Jun 30, 2024
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
14 changes: 0 additions & 14 deletions .eslintignore

This file was deleted.

7 changes: 0 additions & 7 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: 'yarn'

# allow the lock file to change (updating our own workspace versions in monorepo)
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js"
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",

"eslint.useFlatConfig": true
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ini-npm-1.3.8-fb5040b4c0-dfd98b0ca3.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/levn-npm-0.4.1-d183b2d7bb-12c5021c85.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip
Binary file not shown.
Binary file removed .yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/open-npm-8.4.0-df63cfe537-e9545bec64.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/rfdc-npm-1.3.0-272f288ad8-fb2ba8512e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import tseslint from 'typescript-eslint'

import { configs } from './src/index.js'

export default tseslint.config({
name: 'project',
extends: [...configs.recommended],
// ignore since we are using just js, until we eventually switch this to ts
rules: {
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
},
})
194 changes: 0 additions & 194 deletions index.js

This file was deleted.

71 changes: 44 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"main": "index.js",
"type": "module",
"exports": {
".": {
"import": "./src/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"clean:yarn": "rm -rf ./packages/*/node_modules ./packages/*/yarn.lock yarn.lock node_modules",
"clean": "yarn clean:yarn",
"lint": "eslint . --ext .js,.ts,.tsx",
"lint:fix": "eslint . --ext .js,.ts,.tsx --fix",
"clean": "node ./scripts/clean.js",
"clean:yarn": "node ./scripts/clean-yarn.js",
"reset": "node ./scripts/reset.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint:check": "yarn lint:print | eslint-config-prettier-check",
"lint:print": "eslint --print-config src/index.ts",
"prettier": "prettier --write \"{,**/}*.{ts,tsx,js,json,md}\"",
Expand All @@ -36,30 +43,40 @@
]
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-storybook": "^0.6.13",
"eslint-plugin-unicorn": "^48.0.0",
"eslint-plugin-unused-imports": "^3.0.0"
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
"@eslint/compat": "^1.1.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.5.0",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import-x": "^0.5.2",
"eslint-plugin-json": "^4.0.0",
"eslint-plugin-markdown": "^5.0.0",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-storybook": "0.9.0--canary.156.26b630a.0",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-unused-imports": "^4.0.0",
"typescript-eslint": "^7.14.1"
},
"devDependencies": {
"@auto-it/all-contributors": "^10.46.0",
"@auto-it/first-time-contributor": "^10.46.0",
"@auto-it/released": "^10.46.0",
"auto": "^10.46.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.3",
"prettier": "^3.0.0",
"typescript": "^5.1.6"
"@alienfast/tsconfig": "^1.0.1",
"@auto-it/all-contributors": "^11.1.6",
"@auto-it/first-time-contributor": "^11.1.6",
"@auto-it/released": "^11.1.6",
"auto": "^11.1.6",
"execa": "^9.3.0",
"globals": "^15.6.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"typescript": "^5.5.2"
},
"peerDependencies": {
"prettier": "*"
Expand Down
20 changes: 20 additions & 0 deletions scripts/clean-yarn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* eslint-disable no-console,@typescript-eslint/no-floating-promises */
import { $ } from 'execa'
import { rimraf as r } from 'rimraf'

// TODO: promote this as a script to @alienfast/ci once it is stable

export default {}
console.log('Cleaning yarn...')

// await $`yarn tsc -b --clean`

// packages/*/dist cloud/*/dist .eslintcache ./packages/*/*.log *.log
await Promise.all([
r('./{packages,cloud}/*/node_modules', { glob: true }),
r('yarn.lock'),
r('node_modules'),
r('.yarn/install-state.gz'),
]).then(() => {
$`yarn cache clean`
})
12 changes: 12 additions & 0 deletions scripts/clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable no-console */
import { rimraf as r } from 'rimraf'

// TODO: promote this as a script to @alienfast/ci once it is stable

export default {}
console.log('Cleaning...')

// await $`yarn tsc -b --clean`

// packages/*/dist cloud/*/dist .eslintcache ./packages/*/*.log *.log
await Promise.all([r('.eslintcache'), r('node_modules/.cache'), r('*.log', { glob: true })])
18 changes: 18 additions & 0 deletions scripts/reset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable no-console */
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'

import { $ } from 'execa'

export default {}
const $$ = $({ stdio: 'inherit' })
// TODO: promote this as a script to @alienfast/ci once it is stable

console.log('Resetting...')

const dir = dirname(fileURLToPath(import.meta.url))

await Promise.all([$$`node ${dir}/clean.js`, $$`node ${dir}/clean-yarn.js`])

console.log('Installing...')
await $$`yarn install`
Loading
Loading