Skip to content

Commit

Permalink
feat: Upgrade eslint to latest toolchain (#437)
Browse files Browse the repository at this point in the history
* feat: Upgrade eslint to latest toolchain
* feat: Upgrade prettier to latest toolchain
* feat: Upgrade typescript to latest toolchain
* typescript-eslint@6.14.0
* eslint-config-uber-* vendored as local deps
* bump eslint-plugin-import
* CI: run tes on node 18

---------

Co-authored-by: Zbigniew Zagórski <zbigniew@cartodb.com>
  • Loading branch information
ibgreen and zbigg authored Dec 22, 2023
1 parent 3458868 commit f9872ba
Show file tree
Hide file tree
Showing 24 changed files with 978 additions and 353 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]

steps:
- uses: actions/checkout@v2.1.1
Expand Down
1 change: 0 additions & 1 deletion modules/dev-tools/.alias.json

This file was deleted.

2 changes: 1 addition & 1 deletion modules/dev-tools/docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dev-tools (ib/log-commands *)$ yarn lint fix
yarn run v1.22.5
$ ocular-lint fix
Running prettier in ./src...
+ npx prettier --loglevel warn --write './src/**/*.js' '*.js'
+ npx prettier --log-level warn --write './src/**/*.js' '*.js'
Running eslint in ./src...
+ npx eslint --fix './src/**/*.js'
Lockfile valid.
Expand Down
14 changes: 6 additions & 8 deletions modules/dev-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"@esbuild-plugins/node-globals-polyfill": "^0.2.0",
"@esbuild-plugins/node-modules-polyfill": "^0.2.0",
"@probe.gl/test-utils": "^4.0.3",
"@typescript-eslint/eslint-plugin": "^4.26.1",
"@typescript-eslint/parser": "^4.26.1",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"babel-loader": "8.2.2",
"babel-plugin-add-import-extension": "^1.6.0",
"babel-plugin-istanbul": "^6.0.0",
Expand All @@ -70,23 +70,21 @@
"esbuild": "^0.16.7",
"esbuild-plugin-babel": "git+https://github.com/Pessimistress/esbuild-plugin-babel.git#patch-1",
"esbuild-plugin-external-global": "^1.0.1",
"eslint": "^7.32.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^6.7.0",
"eslint-config-uber-es2015": "^3.0.0",
"eslint-config-uber-jsx": "^3.3.3",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-markdown": "^2.2.0",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.0.0",
"glob": "^7.1.4",
"lerna": "^3.14.1",
"prettier": "2.4.1",
"prettier": "3.0.3",
"prettier-check": "2.0.0",
"tape": "^4.11.0",
"tape-promise": "^4.0.0",
"typescript": "~4.6.0",
"typescript": "^5.2.2",
"ts-node": "~10.9.0",
"tsconfig-paths": "^4.1.1",
"url": "^0.11.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"rules": {
"accessor-pairs": [
2,
{
"getWithoutSet": true
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"rules": {
"no-class-assign": 2,
"arrow-spacing": [
1,
{
"before": true,
"after": true
}
],
"no-const-assign": 2,
"no-dupe-class-members": 2,
"no-this-before-super": 2,
"no-var": 2,
"prefer-arrow-callback": 0,
"prefer-const": 2,
"prefer-spread": 2,
"prefer-template": 2,
"arrow-parens": 0,
"arrow-spacing": [
2,
{
"before": true,
"after": true
}
],
"constructor-super": 2,
"generator-star-spacing": [
2,
{
"before": false,
"after": true
}
],
"object-shorthand": [
2,
"always"
],
"require-yield": 2
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

module.exports = {
extends: [
'./best-practices.json',
'./ecmascript-6.json',
'./miscellaneous.json',
'./stylistic-issues.json',
'../eslint-config-uber-es5/eslintrc.cjs'
],
env: {
es6: true
},
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true
}
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"prefer-reflect": 0
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"rules": {
"no-continue": 2,
"func-style": [
2,
"declaration",
{
"allowArrowFunctions": true
}
],
"lines-around-comment": [
0,
{
"beforeBlockComment": true,
"afterBlockComment": false,
"beforeLineComment": false,
"afterLineComment": false,
"allowBlockStart": true,
"allowBlockEnd": true
}
],
"quote-props": [
2,
"as-needed"
],
"sort-vars": 2,
"wrap-regex": 2
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"rules": {
"no-alert": 2,
"no-caller": 2,
"no-div-regex": 2,
"no-else-return": 2,
"no-eq-null": 2,
"no-extend-native": 2,
"no-labels": 2,
"no-eval": 2,
"no-extra-bind": 2,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-implicit-coercion": 2,
"no-implied-eval": 2,
"no-invalid-this": 2,
"no-iterator": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-param-reassign": 0,
"no-proto": 2,
"no-redeclare": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-throw-literal": 2,
"no-unused-expressions": 2,
"no-useless-call": 2,
"no-void": 1,
"no-warning-comments": [
0,
{
"terms": [
"todo",
"fixme",
"xxx"
],
"location": "start"
}
],
"no-with": 2,
"block-scoped-var": 2,
"complexity": [
2,
11
],
"consistent-return": 2,
"curly": [
2,
"all"
],
"default-case": 2,
"dot-location": [
2,
"property"
],
"dot-notation": [
2,
{
"allowKeywords": true
}
],
"eqeqeq": 2,
"guard-for-in": 2,
"radix": 2,
"vars-on-top": 0,
"wrap-iife": 2,
"yoda": [
2,
"never"
]
}
}
115 changes: 115 additions & 0 deletions modules/dev-tools/src/configuration/eslint-config-uber-es5/errors.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

// These rules relate to possible syntax or logic errors
// Categorized as "errors" here: http://eslint.org/docs/rules/
module.exports = {
rules: {
/**
* Possible Errors Section from http://eslint.org/docs/rules/:
*/

// http://eslint.org/docs/rules/no-cond-assign
'no-cond-assign': 2,

// http://eslint.org/docs/rules/no-constant-condition
'no-constant-condition': 2,

// http://eslint.org/docs/rules/no-console
// highly agreed upon
'no-console': 2,

// http://eslint.org/docs/rules/no-control-regex
'no-control-regex': 2,

// http://eslint.org/docs/rules/no-debugger
// highly agreed upon
'no-debugger': 2,

// http://eslint.org/docs/rules/no-dupe-args
'no-dupe-args': 2,

// http://eslint.org/docs/rules/no-dupe-keys
'no-dupe-keys': 2,

// http://eslint.org/docs/rules/no-duplicate-case
'no-duplicate-case': 2,

// http://eslint.org/docs/rules/no-empty-character-class
'no-empty-character-class': 2,

// http://eslint.org/docs/rules/no-empty
// highly agreed upon
'no-empty': 2,

// http://eslint.org/docs/rules/no-ex-assign
// abnormal behavior in ie 6-8
'no-ex-assign': 2,

// http://eslint.org/docs/rules/no-extra-boolean-cast
// highly agreed upon
'no-extra-boolean-cast': 2,

// http://eslint.org/docs/rules/no-extra-parens
'no-extra-parens': [2, 'functions'],

// http://eslint.org/docs/rules/no-extra-semi
// highly agreed upon
'no-extra-semi': 2,

// http://eslint.org/docs/rules/no-func-assign
'no-func-assign': 2,

// http://eslint.org/docs/rules/no-inner-declarations
'no-inner-declarations': [2, 'functions'],

'no-invalid-regexp': 2,

'no-irregular-whitespace': 2,

'no-obj-calls': 2,

// http://eslint.org/docs/rules/no-prototype-builtins
'no-prototype-builtins': 0,

'no-regex-spaces': 2,

'no-sparse-arrays': 2,

// http://eslint.org/docs/rules/no-template-curly-in-string
'no-template-curly-in-string': 2,

'no-unexpected-multiline': 2,

'no-unreachable': 2,

// http://eslint.org/docs/rules/no-unsafe-finally
'no-unsafe-finally': 2,

// http://eslint.org/docs/rules/no-unsafe-negation
'no-unsafe-negation': 2,

'use-isnan': 2,

'valid-jsdoc': 0,

'valid-typeof': 2
}
};
Loading

0 comments on commit f9872ba

Please sign in to comment.