Skip to content

Commit

Permalink
Merge branch 'next' into local/ja/add-street
Browse files Browse the repository at this point in the history
  • Loading branch information
KeisukeYamashita authored Apr 4, 2024
2 parents 5b6b5c3 + 5860783 commit 6082feb
Show file tree
Hide file tree
Showing 898 changed files with 23,028 additions and 64,538 deletions.
114 changes: 62 additions & 52 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
const { defineConfig } = require('eslint-define-config');
const { readGitignoreFiles } = require('eslint-gitignore');

/// <reference types="@eslint-types/deprecation" />
/// <reference types="@eslint-types/jsdoc" />
/// <reference types="@eslint-types/prettier" />
/// <reference types="@eslint-types/typescript-eslint" />
/// <reference types="@eslint-types/unicorn" />

module.exports = defineConfig({
ignorePatterns: [
...readGitignoreFiles(),
'.eslintrc.js', // Skip self linting
'.eslintrc.cjs', // Skip self linting
],
root: true,
env: {
Expand All @@ -15,87 +21,49 @@ module.exports = defineConfig({
reportUnusedDisableDirectives: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:prettier/recommended',
'plugin:deprecation/recommended',
'plugin:jsdoc/recommended-typescript-error',
'plugin:unicorn/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
sourceType: 'module',
warnOnUnsupportedTypeScriptVersion: false,
},
plugins: ['@typescript-eslint', 'prettier', 'deprecation', 'jsdoc'],
rules: {
eqeqeq: ['error', 'always', { null: 'ignore' }],
'logical-assignment-operators': 'error',
'no-else-return': 'error',
'prefer-template': 'error',
'no-restricted-globals': ['error', 'Intl'],
'prefer-exponentiation-operator': 'error',
'prefer-template': 'error',

'deprecation/deprecation': 'error',

'unicorn/no-array-callback-reference': 'off', // reduces readability
'unicorn/no-nested-ternary': 'off', // incompatible with prettier
'unicorn/no-null': 'off', // incompatible with TypeScript
'unicorn/no-zero-fractions': 'off', // deactivated to raise awareness of floating operations
'unicorn/number-literal-case': 'off', // incompatible with prettier

// TODO @Shinigami92 2023-09-23: prefer-at should be turned on when we drop support for Node 14.
'unicorn/prefer-at': 'off',
// TODO @Shinigami92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14.
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prefer-ternary': 'off', // ternaries aren't always better

// TODO @Shinigami92 2023-09-23: The following rules currently conflict with our code.
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
'unicorn/better-regex': 'off',
'unicorn/catch-error-name': 'off',
'unicorn/consistent-destructuring': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/escape-case': 'off',
'unicorn/explicit-length-check': 'off',
'unicorn/filename-case': 'off',
'unicorn/import-style': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-push-push': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-console-spaces': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/no-hex-escape': 'off',
'unicorn/no-instanceof-array': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-new-array': 'off',
'unicorn/no-object-as-default-parameter': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/no-useless-switch-case': 'off',
'unicorn/no-zero-fractions': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-array-flat-map': 'off',
'unicorn/prefer-array-some': 'off',
'unicorn/prefer-code-point': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/prefer-includes': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-native-coercion-functions': 'off',
'unicorn/prefer-negative-index': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prefer-object-from-entries': 'off',
'unicorn/prefer-optional-catch-binding': 'off',
'unicorn/prefer-spread': 'off',
'unicorn/prefer-string-slice': 'off',
'unicorn/prefer-string-starts-ends-with': 'off',
'unicorn/prefer-ternary': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/require-array-join-separator': 'off',
'unicorn/switch-case-braces': 'off',
'unicorn/text-encoding-identifier-case': 'off',

'@typescript-eslint/array-type': [
'error',
{ default: 'array-simple', readonly: 'generic' },
],
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/naming-convention': [
Expand All @@ -118,23 +86,41 @@ module.exports = defineConfig({
'error',
{ ignoreParameters: true },
],
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unnecessary-condition': 'off', // requires `strictNullChecks` to be enabled
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: 'block-like', next: '*' },
],
'@typescript-eslint/prefer-regexp-exec': 'error',
'@typescript-eslint/restrict-plus-operands': [
'error',
{
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumberAndString: true,
allowRegExp: false,
},
],
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true, allowBoolean: true },
],
'@typescript-eslint/switch-exhaustiveness-check': [
'error',
{ requireDefaultForNonUnion: true },
],
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/unified-signatures': 'off', // incompatible with our api docs generation

// TODO @ST-DDT 2023-10-10: The following rules currently conflict with our code.
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
'@typescript-eslint/no-confusing-void-expression': 'off',

'jsdoc/no-types': 'error',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-jsdoc': 'off', // Enabled only for src/**/*.ts
'jsdoc/require-returns': 'off',
'jsdoc/sort-tags': [
'error',
Expand Down Expand Up @@ -167,6 +153,30 @@ module.exports = defineConfig({
'jsdoc/require-jsdoc': 'error',
},
},
{
files: ['src/locale/**/*.ts'],
rules: {
'unicorn/filename-case': 'off', // our locale files have a custom naming scheme
},
},
{
files: ['src/definitions/**/*.ts', 'src/locales/**/*.ts'],
rules: {
'unicorn/filename-case': [
'error',
{
case: 'snakeCase',
// TODO @ST-DDT 2023-10-21: rename the definitions in v9
ignore: [
/chemicalElement\.ts$/,
/directoryPaths\.ts$/,
/mimeTypes\.ts$/,
],
},
],
'unicorn/text-encoding-identifier-case': 'off',
},
},
{
files: ['test/**/*.spec.ts'],
extends: ['plugin:vitest/recommended'],
Expand Down
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* -crlf
* text eol=lf
*.png binary
18 changes: 1 addition & 17 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
# These owners will be the default owners for everything in the repo.
# Unless a later match takes precedence, @faker-js/maintainers will
# be requested for review when someone opens a pull request.

* @faker-js/maintainers

# ================================================
# Docs owners ...
# ================================================

/docs/ @faker-js/maintainers-docs @faker-js/maintainers
netlify.toml @faker-js/maintainers-docs @faker-js/maintainers
README.md @faker-js/maintainers-docs @faker-js/maintainers
CONTRIBUTING.md @faker-js/maintainers-docs @faker-js/maintainers

# ================================================
# CODEOWNERS owners ...
# ================================================

/.github/CODEOWNERS @faker-js/maintainers
* @faker-js/maintainers
35 changes: 18 additions & 17 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"config:best-practices",
"schedule:earlyMondays",
"group:allNonMajor",
":prHourlyLimitNone",
"helpers:pinGitHubActionDigests"
":prHourlyLimitNone"
],
"labels": ["c: dependencies"],
"labels": ["c: dependencies", "p: 1-normal"],
"lockFileMaintenance": {
"enabled": true
},
"milestone": 15,
"reviewersFromCodeOwners": true,
"rangeStrategy": "bump",
"rangeStrategy": "pin",
"packageRules": [
{
"groupName": "devDependencies",
"matchDepTypes": ["devDependencies"],
"rangeStrategy": "bump"
"matchDepTypes": ["devDependencies"]
},
{
"groupName": "dependencies",
Expand All @@ -32,12 +34,16 @@
"rangeStrategy": "replace"
},
{
"groupName": "typescript-eslint",
"matchPackagePrefixes": ["@typescript-eslint/"]
"groupName": "eslint",
"matchPackagePrefixes": [
"@typescript-eslint/",
"@eslint-types/",
"eslint"
]
},
{
"groupName": "vitest",
"matchPackageNames": ["@vitest/coverage-v8", "@vitest/ui", "vitest"]
"matchPackagePrefixes": ["@vitest/", "vitest"]
},
{
"groupName": "prettier",
Expand All @@ -49,16 +55,11 @@
},
{
"groupName": "doc-dependencies",
"matchPackageNames": [
"@algolia/client-search",
"typedoc",
"typedoc-plugin-missing-exports",
"vitepress"
]
"matchPackageNames": ["@algolia/client-search", "ts-morph", "vitepress"]
}
],
"vulnerabilityAlerts": {
"labels": ["c: security"],
"labels": ["c: security", "p: 2-high"],
"assignees": ["team:maintainers"]
}
}
Loading

0 comments on commit 6082feb

Please sign in to comment.