Skip to content

Commit

Permalink
feat!: migrate to eslint 9 (#122)
Browse files Browse the repository at this point in the history
* feat!: migrate to eslint 9

BREAKING CHANGE: use eslint 9 and assume typescript projects

* ci: skip ts dep check

* chore: pass linter

* chore(release): 5.2.3-dev.0 [skip ci]

* fix: update import-style rule

* chore(release): 5.2.3-dev.1 [skip ci]

* fix: linting

* chore: update README

* chore: bump minimum node version

* chore: code review

* chore(release): 5.2.3-dev.2 [skip ci]

* chore: add stylistic

* chore: add stylistic

* chore(release): 5.2.3-dev.3 [skip ci]

---------

Co-authored-by: svc-cli-bot <[email protected]>
  • Loading branch information
mdonnalley and svc-cli-bot authored Jan 27, 2025
1 parent eb27b1c commit b683efd
Show file tree
Hide file tree
Showing 8 changed files with 1,907 additions and 327 deletions.
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ jobs:
linux-unit-tests:
needs: yarn-lockfile-check
uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main
with:
skipTsDepCheck: true
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@oclif/prettier-config"
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ eslint-config-oclif
eslint config for oclif

[![Version](https://img.shields.io/npm/v/eslint-config-oclif.svg)](https://npmjs.org/package/eslint-config-oclif)
[![CircleCI](https://circleci.com/gh/oclif/eslint-config-oclif/tree/main.svg?style=svg)](https://circleci.com/gh/oclif/eslint-config-oclif/tree/main)
[![Known Vulnerabilities](https://snyk.io/test/npm/eslint-config-oclif/badge.svg)](https://snyk.io/test/npm/eslint-config-oclif)
[![Downloads/week](https://img.shields.io/npm/dw/eslint-config-oclif.svg)](https://npmjs.org/package/eslint-config-oclif)
[![License](https://img.shields.io/npm/l/eslint-config-oclif.svg)](https://github.com/oclif/eslint-config-oclif/blob/main/package.json)
[![License](https://img.shields.io/npm/l/eslint-config-oclif.svg)](https://github.com/oclif/eslint-config-oclif/blob/main/LICENSE)
168 changes: 137 additions & 31 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,139 @@
module.exports = {
extends: [
'eslint:recommended',
'xo-space',
'plugin:n/recommended',
'plugin:unicorn/recommended',
],
plugins: [
'n',
'mocha',
'unicorn',
],
rules: {
'capitalized-comments': 0,
'comma-dangle': ['error', 'always-multiline'],
'default-case': 0,
'no-multi-spaces': 0,
'n/shebang': 0,
curly: 0,
indent: ['error', 2, {SwitchCase: 0, MemberExpression: 0}],
quotes: ['error', 'single', {avoidEscape: true}],
semi: ['error', 'never'],
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-module': 'warn',
'logical-assignment-operators': 'off',
import eslint from '@eslint/js'
import xo from 'eslint-config-xo/space'
import importPlugin from 'eslint-plugin-import'
import jsdoc from 'eslint-plugin-jsdoc'
import mocha from 'eslint-plugin-mocha'
import nodePlugin from 'eslint-plugin-n'
import perfectionist from 'eslint-plugin-perfectionist'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import tseslint, {configs} from 'typescript-eslint'

export default tseslint.config(
eslint.configs.recommended,
configs.recommended,
...xo,
mocha.configs.flat.recommended,
nodePlugin.configs['flat/recommended'],
eslintPluginUnicorn.configs['flat/recommended'],
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
perfectionist.configs['recommended-natural'],
jsdoc.configs['flat/recommended'],
{
files: ['test/**/*.test.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
},
globals: {
describe: true,
it: true,
{
languageOptions: {
globals: {
describe: true,
it: true,
NodeJS: true,
},
},
plugins: {
mocha,
n: nodePlugin,
},
rules: {
'@stylistic/comma-dangle': ['error', 'always-multiline'],
'@stylistic/indent': [
'error',
2,
{
MemberExpression: 0,
SwitchCase: 0,
},
],
'@stylistic/no-multi-spaces': 0,
'@stylistic/quotes': [
'error',
'single',
{
avoidEscape: true,
},
],
'@stylistic/semi': 0,
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-var-requires': 'off',
'capitalized-comments': 0,
curly: 0,
'default-case': 0,
'import/no-unresolved': 'error',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/tag-lines': 'off',
'logical-assignment-operators': 'off',
'mocha/no-async-describe': 'off',
'mocha/no-identical-title': 'off',
'mocha/no-mocha-arrows': 'off',
'mocha/no-setup-in-describe': 'off',
'n/hashbang': 0,
'n/no-missing-import': 'off',
'n/no-unsupported-features/es-syntax': 'off',
'no-dupe-class-members': 'off',
'no-redeclare': 'off',
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'no-useless-constructor': 'off',
'perfectionist/sort-classes': [
'error',
{
groups: [
'index-signature',
'static-property',
'property',
'private-property',
'constructor',
'static-method',
'static-private-method',
['get-method', 'set-method'],
'method',
'private-method',
'unknown',
],
order: 'asc',
type: 'alphabetical',
},
],
'perfectionist/sort-modules': 'off',
'unicorn/import-style': [
'error',
{
styles: {
'node:path': {
named: true,
},
},
},
],
'unicorn/no-await-expression-member': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-module': 'warn',
'unicorn/prevent-abbreviations': 'off',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
},
}
)
33 changes: 26 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,52 @@
{
"name": "eslint-config-oclif",
"description": "eslint config for oclif",
"version": "5.2.2",
"version": "5.2.3-dev.3",
"author": "Salesforce",
"bugs": "https://github.com/oclif/eslint-config-oclif/issues",
"dependencies": {
"@eslint/compat": "^1.2.5",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.18.0",
"@stylistic/eslint-plugin": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^8",
"@typescript-eslint/parser": "^8",
"eslint-config-oclif": "^5.2.2",
"eslint-config-xo": "^0.46.0",
"eslint-config-xo-space": "^0.35.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.6.1",
"eslint-plugin-mocha": "^10.5.0",
"eslint-plugin-n": "^15.1.0",
"eslint-plugin-unicorn": "^48.0.1"
"eslint-plugin-n": "^17.15.1",
"eslint-plugin-perfectionist": "^4",
"eslint-plugin-unicorn": "^56.0.1",
"typescript-eslint": "^8.20.0"
},
"devDependencies": {
"eslint": "^8.57.1"
"@oclif/prettier-config": "^0.2.1",
"eslint": "^9",
"typescript": "^5"
},
"engines": {
"node": ">=18.0.0"
"node": ">=18.18.0"
},
"files": [
"/index.js"
],
"homepage": "https://github.com/oclif/eslint-config-oclif",
"keywords": [
"oclif"
"oclif",
"eslint",
"eslint-config",
"eslint config"
],
"license": "MIT",
"main": "index.js",
"repository": "oclif/eslint-config-oclif",
"scripts": {
"test": "eslint -c index.js .",
"build": "echo 'nothing to build!'"
}
},
"type": "module"
}
Loading

0 comments on commit b683efd

Please sign in to comment.