Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: planetlabs/eslint-config-planet
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v23.0.2
Choose a base ref
...
head repository: planetlabs/eslint-config-planet
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v23.1.0
Choose a head ref
  • 3 commits
  • 6 files changed
  • 2 contributors

Commits on Jan 9, 2025

  1. Configure import sorting

    tschaub committed Jan 9, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e8adf38 View commit details
  2. Merge pull request #105 from planetlabs/sorted-imports

    Configure import sorting
    tschaub authored Jan 9, 2025
    Copy the full SHA
    dcf6e9d View commit details
  3. 23.1.0

    tschaub committed Jan 9, 2025
    Copy the full SHA
    d58d452 View commit details
Showing with 47 additions and 104 deletions.
  1. +1 −1 examples/es6/main.js
  2. +1 −1 examples/react/component.js
  3. +20 −61 index.js
  4. +23 −38 package-lock.json
  5. +1 −2 package.json
  6. +1 −1 react.js
2 changes: 1 addition & 1 deletion examples/es6/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import foo from './local-module.js';
import fs from 'fs';
import path from 'path';
import foo from './local-module.js';

const main = paths =>
Promise.all(
2 changes: 1 addition & 1 deletion examples/react/component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {string} from 'prop-types';
import React, {useCallback, useState} from 'react';
import ReactDOM from 'react-dom';
import {string} from 'prop-types';

const HelloMessage = ({name}) => {
const [greeting, setGreeting] = useState('Hello');
81 changes: 20 additions & 61 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import globals from 'globals';
import importPlugin from 'eslint-plugin-import';
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import prettier from 'eslint-plugin-prettier';
import sortImportPlugin from 'eslint-plugin-sort-imports-es6-autofix';
import globals from 'globals';

export default [
js.configs.recommended,
@@ -11,7 +10,6 @@ export default [
name: 'planet/recommended',
plugins: {
prettier,
'sort-imports-es6-autofix': sortImportPlugin,
},

languageOptions: {
@@ -25,41 +23,13 @@ export default [
},

rules: {
// core rules
'array-callback-return': 'error',
'block-scoped-var': 'error',
curly: 'error',
'default-case': 'error',

'dot-notation': [
'error',
{
allowPattern: '^[a-z]+(_[a-z]+)+$',
},
],

'dot-notation': ['error', {allowPattern: '^[a-z]+(_[a-z]+)+$'}],
eqeqeq: 'error',
'import/default': 'error',

'import/extensions': [
'error',
'always',
{
ignorePackages: true,
},
],

'import/first': 'error',
'import/named': 'error',
'import/no-duplicates': 'error',
'import/no-self-import': 'error',

'import/no-unresolved': [
'error',
{
commonjs: true,
},
],

'no-case-declarations': 'error',
'no-cond-assign': 'error',
'no-console': 'error',
@@ -94,40 +64,29 @@ export default [
'no-unexpected-multiline': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',

'no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
},
],

'no-unused-vars': ['error', {ignoreRestSiblings: true}],
'no-use-before-define': ['error', 'nofunc'],
'no-var': 'error',
'prefer-const': 'error',

'prettier/prettier': [
'error',
{
singleQuote: true,
bracketSpacing: false,
arrowParens: 'avoid',
},
],

strict: 'off',
'use-isnan': 'error',
'valid-typeof': 'error',

'sort-imports-es6-autofix/sort-imports-es6': [
// import plugin
'import/default': 'error',
'import/extensions': ['error', 'always', {ignorePackages: true}],
'import/first': 'error',
'import/named': 'error',
'import/no-duplicates': 'error',
'import/no-self-import': 'error',
'import/no-unresolved': ['error', {commonjs: true}],
'import/order': ['error', {named: true, alphabetize: {order: 'asc'}}],

// prettier plugin
'prettier/prettier': [
'error',
{
ignoreCase: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
},
{singleQuote: true, bracketSpacing: false, arrowParens: 'avoid'},
],

'use-isnan': 'error',
'valid-typeof': 'error',
},
},
];
61 changes: 23 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-planet",
"version": "23.0.2",
"version": "23.1.0",
"description": "ESLint config for Planet projects",
"main": "index.js",
"files": [
@@ -32,7 +32,6 @@
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
"globals": "^15.14.0",
"prettier": "^3.4.2"
}
2 changes: 1 addition & 1 deletion react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import planetConfig from './index.js';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import planetConfig from './index.js';

export default [
...planetConfig,