-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Merge pull request #125 from Brightspace/gzolla/eslint9
BREAKING CHANGE: add eslint9 config files
- Loading branch information
Showing
18 changed files
with
812 additions
and
510 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// nr = not as per eslint:recommended | ||
import js from '@eslint/js'; | ||
|
||
export default [js.configs.recommended, { | ||
'rules': { | ||
'comma-spacing': 2, // nr | ||
'eol-last': 2, // nr | ||
'eqeqeq': [2, 'always', { 'null': 'ignore' }], // nr | ||
'indent': [2, 'tab', { 'SwitchCase': 1 }], // nr | ||
'keyword-spacing': 2, | ||
'linebreak-style': ['error', 'unix'], // nr | ||
'new-parens': 2, // nr | ||
'no-debugger': 2, | ||
'no-dupe-args': 2, | ||
'no-dupe-keys': 2, | ||
'no-duplicate-case': 2, | ||
'no-ex-assign': 2, | ||
'no-fallthrough': 2, | ||
'no-invalid-this': 2, // nr | ||
'no-multiple-empty-lines': [2, { 'max': 1 }], // nr | ||
'no-multi-spaces': 2, // nr | ||
'no-new-wrappers': 2, // nr | ||
'no-trailing-spaces': 2, // nr | ||
'no-undef': 2, | ||
'no-unneeded-ternary': 2, // nr | ||
'no-unreachable': 2, | ||
'no-unused-vars': [2, { | ||
'vars': 'all', | ||
'args': 'after-used', | ||
'ignoreRestSiblings': true | ||
}], | ||
'no-use-before-define': [2, 'nofunc'], // nr | ||
'no-var': 2, // nr | ||
'object-curly-spacing': [2, 'always'], | ||
'prefer-const': 2, // nr | ||
'quotes': [2, 'single', 'avoid-escape'], // nr | ||
'semi': 2, // nr | ||
'space-before-blocks': [2, 'always'], // nr | ||
'space-before-function-paren': [2, 'never'], //nr | ||
'space-in-parens': [2, 'never'], | ||
'space-infix-ops': 2, // nr | ||
'strict': [2, 'global'], // nr | ||
'valid-typeof': 2 | ||
} | ||
}]; |
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,43 @@ | ||
import parser from '@babel/eslint-parser'; | ||
import globals from 'globals'; | ||
import baseConfig from './base.js'; | ||
import html from 'eslint-plugin-html'; | ||
import importPlugin from 'eslint-plugin-import'; | ||
import sortClassMembersPlugin from 'eslint-plugin-sort-class-members'; | ||
import { getSortMemberRules } from '../utils.js'; | ||
|
||
export default [ | ||
...baseConfig, | ||
{ | ||
plugins: { | ||
html, | ||
'import': importPlugin, | ||
'sort-class-members': sortClassMembersPlugin | ||
}, | ||
languageOptions: { | ||
parser, | ||
parserOptions: { | ||
'requireConfigFile': false | ||
}, | ||
globals: { | ||
...globals.browser, | ||
'D2L': false | ||
}, | ||
}, | ||
rules: { | ||
'arrow-spacing': 2, | ||
'no-confusing-arrow': 2, | ||
'no-duplicate-imports': 2, | ||
'no-useless-constructor': 2, | ||
'prefer-arrow-callback': 2, | ||
'prefer-spread': 2, | ||
'prefer-template': 2, | ||
'sort-imports': [2, { 'ignoreCase': true }], | ||
'strict': [2, 'never'], | ||
'import/extensions': ['error', 'ignorePackages'], | ||
'import/no-absolute-path': 2, | ||
'no-console': ['error', { 'allow': ['warn', 'error'] }], | ||
...getSortMemberRules() | ||
} | ||
} | ||
]; |
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,78 @@ | ||
import browserConfig from './browser.js'; | ||
import lit from 'eslint-plugin-lit'; | ||
import { getSortMemberRules } from '../utils.js'; | ||
|
||
const sortMemberRules = getSortMemberRules([ | ||
'[lit-static-properties]', | ||
'[static-properties]', | ||
'[static-methods]', | ||
'[properties]', | ||
'constructor', | ||
'[accessor-pairs]', | ||
'[accessors]', | ||
'[lit-methods]', | ||
'[methods]', | ||
'[private-accessor-pairs]', | ||
'[private-accessors]', | ||
'[private-properties]', | ||
'[private-methods]' | ||
], { | ||
'lit-methods': [ | ||
{ 'name': 'adoptedCallback', 'type': 'method' }, | ||
{ 'name': 'attributeChangedCallback', 'type': 'method' }, | ||
{ 'name': 'connectedCallback', 'type': 'method' }, | ||
{ 'name': 'disconnectedCallback', 'type': 'method' }, | ||
{ 'name': 'firstUpdated', 'type': 'method' }, | ||
{ 'name': 'getUpdateComplete', 'type': 'method' }, | ||
{ 'name': 'performUpdate', 'type': 'method' }, | ||
{ 'name': 'render', 'type': 'method' }, | ||
{ 'name': 'scheduleUpdate', 'type': 'method' }, | ||
{ 'name': 'shouldUpdate', 'type': 'method' }, | ||
{ 'name': 'update', 'type': 'method' }, | ||
{ 'name': 'updated', 'type': 'method' }, | ||
{ 'name': 'willUpdate', 'type': 'method' } | ||
], | ||
'lit-static-properties': [ | ||
{ 'name': 'properties', 'static': true }, | ||
{ 'name': 'styles', 'static': true } | ||
] | ||
}); | ||
|
||
export default [ | ||
...browserConfig, | ||
{ | ||
plugins: { lit }, | ||
rules: { | ||
'lit/attribute-value-entities': 2, | ||
'lit/binding-positions': 2, | ||
'lit/lifecycle-super': 2, | ||
'lit/no-duplicate-template-bindings': 2, | ||
'lit/no-invalid-escape-sequences': 2, | ||
'lit/no-invalid-html': 2, | ||
'lit/no-legacy-imports': 2, | ||
'lit/no-legacy-template-syntax': 2, | ||
'lit/no-private-properties': [2, { 'private': '^(__|_)' }], | ||
'lit/no-property-change-update': 2, | ||
'lit/no-native-attributes': 1, | ||
'lit/no-template-arrow': 2, | ||
'lit/no-template-bind': 2, | ||
'lit/no-template-map': 0, | ||
'lit/no-this-assign-in-render': 2, | ||
'lit/no-useless-template-literals': 2, | ||
'lit/no-value-attribute': 2, | ||
'lit/prefer-nothing': 2, | ||
...sortMemberRules | ||
} | ||
}, | ||
{ | ||
'files': ['./**/lang/*.js'], | ||
'rules': { | ||
'quotes': 0 | ||
} | ||
}, { | ||
'files': ['./**/demo/*.html'], | ||
'rules': { | ||
'no-console': 0 | ||
} | ||
} | ||
]; |
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,20 @@ | ||
import globals from 'globals'; | ||
import baseConfig from './base.js'; | ||
|
||
export default [ | ||
...baseConfig, | ||
{ | ||
'languageOptions': { | ||
'parserOptions': { | ||
'sourceType': 'module' | ||
}, | ||
'globals': { | ||
...globals.node, | ||
...globals.es2024 | ||
}, | ||
}, | ||
'rules': { | ||
'no-console':0 | ||
} | ||
} | ||
]; |
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,25 @@ | ||
import globals from 'globals'; | ||
import baseConfig from './base.js'; | ||
import react from 'eslint-plugin-react'; | ||
|
||
export default [ | ||
...baseConfig, | ||
{ | ||
'languageOptions': { | ||
'parserOptions': { | ||
'ecmaFeatures': { | ||
'jsx': true | ||
}, | ||
'sourceType': 'module' | ||
}, | ||
'globals': { | ||
...globals.browser, | ||
...globals.es2015, | ||
...globals.jest, | ||
...globals.node, | ||
}, | ||
'ecmaVersion': 6, | ||
}, | ||
'plugins': { react } | ||
} | ||
]; |
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,16 @@ | ||
import globals from 'globals'; | ||
import litConfig from './lit.js'; | ||
|
||
export default [ | ||
...litConfig, | ||
{ | ||
'languageOptions': { | ||
'globals': { | ||
...globals.mocha, | ||
} | ||
}, | ||
'rules': { | ||
'no-invalid-this': 0 | ||
} | ||
} | ||
]; |
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 @@ | ||
export { nodeConfig as default } from './index.js'; |
Oops, something went wrong.