Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
27
Frontend-Learner/node_modules/eslint-plugin-unicorn/rules/no-document-cookie.js
generated
vendored
Normal file
27
Frontend-Learner/node_modules/eslint-plugin-unicorn/rules/no-document-cookie.js
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import {GlobalReferenceTracker} from './utils/global-reference-tracker.js';
|
||||
|
||||
const MESSAGE_ID = 'no-document-cookie';
|
||||
const messages = {
|
||||
[MESSAGE_ID]: 'Do not use `document.cookie` directly.',
|
||||
};
|
||||
|
||||
const tracker = new GlobalReferenceTracker({
|
||||
object: 'document.cookie',
|
||||
filter: ({node}) => node.parent.type === 'AssignmentExpression' && node.parent.left === node,
|
||||
handle: ({node}) => ({node, messageId: MESSAGE_ID}),
|
||||
});
|
||||
|
||||
/** @type {import('eslint').Rule.RuleModule} */
|
||||
const config = {
|
||||
create: context => tracker.listen({context}),
|
||||
meta: {
|
||||
type: 'problem',
|
||||
docs: {
|
||||
description: 'Do not use `document.cookie` directly.',
|
||||
recommended: 'unopinionated',
|
||||
},
|
||||
messages,
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
Loading…
Add table
Add a link
Reference in a new issue