eslint-plugin-wc
Advanced tools
Comparing version 2.0.4 to 2.1.0
@@ -1,17 +0,2 @@ | ||
declare const config: { | ||
extends: string[]; | ||
plugins: string[]; | ||
rules: { | ||
'wc/attach-shadow-constructor': string; | ||
'wc/guard-super-call': string; | ||
'wc/no-child-traversal-in-attributechangedcallback': string; | ||
'wc/no-child-traversal-in-connectedcallback': string; | ||
'wc/no-closed-shadow-root': string; | ||
'wc/no-constructor-params': string; | ||
'wc/no-customized-built-in-elements': string; | ||
'wc/no-invalid-extends': string; | ||
'wc/no-typos': string; | ||
'wc/require-listener-teardown': string; | ||
}; | ||
}; | ||
export default config; | ||
import type { ESLint, Linter } from 'eslint'; | ||
export declare const configFactory: (plugin: ESLint.Plugin) => Linter.FlatConfig; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const config = { | ||
extends: ['plugin:wc/recommended'], | ||
plugins: ['wc'], | ||
rules: { | ||
'wc/attach-shadow-constructor': 'error', | ||
'wc/guard-super-call': 'error', | ||
'wc/no-child-traversal-in-attributechangedcallback': 'error', | ||
'wc/no-child-traversal-in-connectedcallback': 'error', | ||
'wc/no-closed-shadow-root': 'error', | ||
'wc/no-constructor-params': 'error', | ||
'wc/no-customized-built-in-elements': 'error', | ||
'wc/no-invalid-extends': 'error', | ||
'wc/no-typos': 'error', | ||
'wc/require-listener-teardown': 'error' | ||
} | ||
exports.configFactory = void 0; | ||
const recommended_js_1 = require("./recommended.js"); | ||
const configFactory = (plugin) => { | ||
const base = (0, recommended_js_1.configFactory)(plugin); | ||
return { | ||
...base, | ||
rules: { | ||
...base.rules, | ||
'wc/attach-shadow-constructor': 'error', | ||
'wc/guard-super-call': 'error', | ||
'wc/no-child-traversal-in-attributechangedcallback': 'error', | ||
'wc/no-child-traversal-in-connectedcallback': 'error', | ||
'wc/no-closed-shadow-root': 'error', | ||
'wc/no-constructor-params': 'error', | ||
'wc/no-customized-built-in-elements': 'error', | ||
'wc/no-invalid-extends': 'error', | ||
'wc/no-typos': 'error', | ||
'wc/require-listener-teardown': 'error' | ||
} | ||
}; | ||
}; | ||
exports.default = config; | ||
exports.configFactory = configFactory; |
@@ -1,12 +0,2 @@ | ||
declare const config: { | ||
plugins: string[]; | ||
parserOptions: { | ||
sourceType: string; | ||
}; | ||
rules: { | ||
'wc/no-constructor-attributes': string; | ||
'wc/no-invalid-element-name': string; | ||
'wc/no-self-class': string; | ||
}; | ||
}; | ||
export default config; | ||
import type { ESLint, Linter } from 'eslint'; | ||
export declare const configFactory: (plugin: ESLint.Plugin) => Linter.FlatConfig; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const config = { | ||
plugins: ['wc'], | ||
parserOptions: { | ||
sourceType: 'module' | ||
exports.configFactory = void 0; | ||
const configFactory = (plugin) => ({ | ||
plugins: { | ||
wc: plugin | ||
}, | ||
@@ -13,3 +13,3 @@ rules: { | ||
} | ||
}; | ||
exports.default = config; | ||
}); | ||
exports.configFactory = configFactory; |
@@ -0,1 +1,2 @@ | ||
import type { ESLint } from 'eslint'; | ||
export declare const rules: { | ||
@@ -26,29 +27,6 @@ 'attach-shadow-constructor': import("eslint").Rule.RuleModule; | ||
export declare const configs: { | ||
recommended: { | ||
plugins: string[]; | ||
parserOptions: { | ||
sourceType: string; | ||
}; | ||
rules: { | ||
'wc/no-constructor-attributes': string; | ||
'wc/no-invalid-element-name': string; | ||
'wc/no-self-class': string; | ||
}; | ||
}; | ||
'best-practice': { | ||
extends: string[]; | ||
plugins: string[]; | ||
rules: { | ||
'wc/attach-shadow-constructor': string; | ||
'wc/guard-super-call': string; | ||
'wc/no-child-traversal-in-attributechangedcallback': string; | ||
'wc/no-child-traversal-in-connectedcallback': string; | ||
'wc/no-closed-shadow-root': string; | ||
'wc/no-constructor-params': string; | ||
'wc/no-customized-built-in-elements': string; | ||
'wc/no-invalid-extends': string; | ||
'wc/no-typos': string; | ||
'wc/require-listener-teardown': string; | ||
}; | ||
}; | ||
recommended: ESLint.ConfigData<import("eslint").Linter.RulesRecord>; | ||
'best-practice': ESLint.ConfigData<import("eslint").Linter.RulesRecord>; | ||
'flat/recommended': import("eslint").Linter.FlatConfig; | ||
'flat/best-practice': import("eslint").Linter.FlatConfig; | ||
}; |
@@ -5,3 +5,2 @@ "use strict"; | ||
const attach_shadow_constructor_1 = require("./rules/attach-shadow-constructor"); | ||
const best_practice_1 = require("./configs/best-practice"); | ||
const define_tag_after_class_definition_1 = require("./rules/define-tag-after-class-definition"); | ||
@@ -27,2 +26,5 @@ const expose_class_on_global_1 = require("./rules/expose-class-on-global"); | ||
const recommended_1 = require("./configs/recommended"); | ||
const best_practice_1 = require("./configs/best-practice"); | ||
const legacy_recommended_1 = require("./configs/legacy-recommended"); | ||
const legacy_best_practice_1 = require("./configs/legacy-best-practice"); | ||
const require_listener_teardown_1 = require("./rules/require-listener-teardown"); | ||
@@ -54,5 +56,8 @@ const tag_name_matches_class_1 = require("./rules/tag-name-matches-class"); | ||
}; | ||
const plugin = { rules: exports.rules }; | ||
exports.configs = { | ||
recommended: recommended_1.default, | ||
'best-practice': best_practice_1.default | ||
recommended: legacy_recommended_1.config, | ||
'best-practice': legacy_best_practice_1.config, | ||
'flat/recommended': (0, recommended_1.configFactory)(plugin), | ||
'flat/best-practice': (0, best_practice_1.configFactory)(plugin) | ||
}; |
{ | ||
"name": "eslint-plugin-wc", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"description": "ESLint plugin for Web Components", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -39,2 +39,18 @@ <div align="center"> | ||
Or if you're using ESLint flat configs, add this to your `eslint.config.js`: | ||
```ts | ||
import {configs} from 'eslint-plugin-wc'; | ||
export default [ | ||
configs.recommended, | ||
// or if you want to specify `files`, or other options | ||
{ | ||
...configs.recommended, | ||
files: ['test/**/*.js'] | ||
} | ||
]; | ||
``` | ||
You should also specify settings that will be shared across all the plugin rules. ([More about eslint shared settings](https://eslint.org/docs/user-guide/configuring/configuration-files#adding-shared-settings)) | ||
@@ -41,0 +57,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
162961
91
149
3097