-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps-dev): bump eslint from 8.42.0 to 9.0.0; update to new esli…
…nt flat file config (#3954) In eslint@9 there is a new suggested config file format ("flat") https://github.com/eslint/rfcs/tree/main/designs/2019-config-simplification https://eslint.org/docs/latest/use/configure/configuration-files Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: David Luna <[email protected]> Co-authored-by: Trent Mick <[email protected]>
- Loading branch information
1 parent
c0ed986
commit 335ab65
Showing
23 changed files
with
429 additions
and
594 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and other contributors where applicable. | ||
* Licensed under the BSD 2-Clause License; you may not use this file except in | ||
* compliance with the BSD 2-Clause License. | ||
*/ | ||
|
||
const globals = require('globals'); | ||
const eslintJs = require('@eslint/js'); | ||
const prettierConfig = require('eslint-config-prettier'); | ||
const licenseHeaderPlugin = require('eslint-plugin-license-header'); | ||
const nPlugin = require('eslint-plugin-n'); | ||
const promisePlugin = require('eslint-plugin-promise'); | ||
const importPlugin = require('eslint-plugin-import'); | ||
const prettierPlugin = require('eslint-plugin-prettier'); | ||
|
||
module.exports = [ | ||
{ | ||
// This block should *only* have the "ignores" property. | ||
// https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores | ||
ignores: [ | ||
'*.example.js', // a pattern for uncommited local dev files to avoid linting | ||
'*.example.mjs', // a pattern for uncommited local dev files to avoid linting | ||
|
||
'test_output/**', | ||
'tmp/**', | ||
'.nyc_output/**', | ||
'build/**', | ||
'node_modules/**', | ||
'**/elastic-apm-node.js', | ||
'**/.next/**', | ||
|
||
'examples/esbuild/dist/**', | ||
'examples/typescript/dist/**', | ||
'examples/an-azure-function-app/**', | ||
'lib/opentelemetry-bridge/opentelemetry-core-mini/**', | ||
'test/babel/out.js', | ||
'test/lambda/fixtures/esbuild-bundled-handler/hello.js', | ||
'test/sourcemaps/fixtures/lib/**', | ||
'test/sourcemaps/fixtures/src/**', | ||
'test/stacktraces/fixtures/dist/**', | ||
'test/types/transpile/index.js', | ||
'test/types/transpile-default/index.js', | ||
], | ||
}, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: 'module', | ||
globals: { | ||
...globals.node, | ||
fetch: false, // not present in node globals (readonly) | ||
}, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, // to parse nextjs files | ||
}, | ||
}, | ||
}, | ||
plugins: { | ||
'license-header': licenseHeaderPlugin, | ||
n: nPlugin, | ||
promise: promisePlugin, | ||
import: importPlugin, | ||
prettier: prettierPlugin, | ||
}, | ||
rules: { | ||
...eslintJs.configs.recommended.rules, | ||
...prettierConfig.rules, | ||
'prettier/prettier': ['error'], | ||
'license-header/header': ['error', './dev-utils/license-header.js'], | ||
|
||
// Restoring some config from standardjs that we want to maintain at least | ||
// for now -- to assist with transition to prettier. | ||
'no-unused-vars': [ | ||
// See taav for possible better 'no-unused-vars' rule. | ||
'error', | ||
{ | ||
args: 'none', | ||
caughtErrors: 'none', | ||
ignoreRestSiblings: true, | ||
vars: 'all', | ||
}, | ||
], | ||
'no-empty': [ | ||
'error', | ||
{ | ||
allowEmptyCatch: true, | ||
}, | ||
], | ||
'no-constant-condition': [ | ||
'error', | ||
{ | ||
checkLoops: false, | ||
}, | ||
], | ||
'n/handle-callback-err': ['error', '^(err|error)$'], | ||
'n/no-callback-literal': ['error'], | ||
'n/no-deprecated-api': ['error'], | ||
'n/no-exports-assign': ['error'], | ||
'n/no-new-require': ['error'], | ||
'n/no-path-concat': ['error'], | ||
'n/process-exit-as-throw': ['error'], | ||
'promise/param-names': ['error'], | ||
// Undo this config from eslint:recommended for now (standardjs didn't have it.) | ||
'require-yield': ['off'], | ||
'import/export': 'error', | ||
'import/first': 'error', | ||
'import/no-absolute-path': [ | ||
'error', | ||
{ esmodule: true, commonjs: true, amd: false }, | ||
], | ||
'import/no-duplicates': 'error', | ||
'import/no-named-default': 'error', | ||
'import/no-webpack-loader-syntax': 'error', | ||
// Some defaults have changed in v9 | ||
'dot-notation': ['error'], | ||
'new-cap': ['error', { capIsNew: false }], | ||
'no-eval': ['error', { allowIndirect: true }], | ||
'no-new': ['error'], | ||
yoda: ['error'], | ||
'valid-typeof': ['error'], | ||
}, | ||
}, | ||
]; |
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,7 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and other contributors where applicable. | ||
* Licensed under the BSD 2-Clause License; you may not use this file except in | ||
* compliance with the BSD 2-Clause License. | ||
*/ | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
} | ||
}; | ||
|
||
module.exports = nextConfig | ||
module.exports = nextConfig; |
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,7 +1,13 @@ | ||
import '../styles/globals.css' | ||
/* | ||
* Copyright Elasticsearch B.V. and other contributors where applicable. | ||
* Licensed under the BSD 2-Clause License; you may not use this file except in | ||
* compliance with the BSD 2-Clause License. | ||
*/ | ||
|
||
import '../styles/globals.css'; | ||
|
||
function MyApp({ Component, pageProps }) { | ||
return <Component {...pageProps} /> | ||
return <Component {...pageProps} />; | ||
} | ||
|
||
export default MyApp | ||
export default MyApp; |
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,5 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and other contributors where applicable. | ||
* Licensed under the BSD 2-Clause License; you may not use this file except in | ||
* compliance with the BSD 2-Clause License. | ||
*/ | ||
|
||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction | ||
|
||
export default function handler(req, res) { | ||
res.status(200).json({ name: 'John Doe' }) | ||
res.status(200).json({ name: 'John Doe' }); | ||
} |
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
Oops, something went wrong.