Skip to content

Commit

Permalink
chore(eslint): streamline configs into flat config file (#569)
Browse files Browse the repository at this point in the history
eslintrc configs are [deprecated with
eslint@9^](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated)
instead, [flat config files are
used](https://eslint.org/docs/latest/use/configure/configuration-files)

needed for #566
  • Loading branch information
patricebender authored Apr 11, 2024
1 parent 7bb48b5 commit a90a75f
Show file tree
Hide file tree
Showing 7 changed files with 509 additions and 73 deletions.
27 changes: 0 additions & 27 deletions .eslintrc

This file was deleted.

7 changes: 0 additions & 7 deletions db-service/test/tsc/ts.eslintrc.cjs

This file was deleted.

62 changes: 62 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use strict'

const eslint_js = require('@eslint/js')
const eslint_ts = require('@typescript-eslint/eslint-plugin')
const typescript_parser = require('@typescript-eslint/parser')
const globals = require('globals')

module.exports = [
// global rules for all files
eslint_js.configs.recommended,
// Generic config for JavaScript files: Setup environment, version, etc.
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
globals: {
...globals.node,
...globals.jest,
...globals.es6,
SELECT: true,
INSERT: true,
UPSERT: true,
UPDATE: true,
DELETE: true,
CREATE: true,
DROP: true,
CDL: true,
CQL: true,
CXL: true,
},
},
rules: {
'no-extra-semi': 'off',
'no-unused-vars': ['warn', { argsIgnorePattern: 'lazy' }],
'no-console': 'error',
},
},
{
files: ['**/*.ts'],
plugins: {
'@typescript-eslint': eslint_ts,
},
languageOptions: {
parser: typescript_parser,
globals: {
...globals.node,
},
},
rules: {
...eslint_ts.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-explicit-any': ['warn'],
},
},
{
files: ['**/hana/**/*.js'],
rules: {
'no-console': 'warn',
},
},
]
17 changes: 0 additions & 17 deletions hana/test/.eslintrc

This file was deleted.

Loading

0 comments on commit a90a75f

Please sign in to comment.